---
schema_version: "1"
id: 3477e82ab08270aea059515ef2ff8065ddd587ebe243a6ea981975524220acca
title: ポリシー間のデータ共有
collection: mulesoft
version: current
locale: ja-jp
portal_url: https://docs.salesforce.com/mulesoft/current/ja-jp/pdk/1.4/policies-pdk-configure-features-streamproperties.md
canonical_url: https://docs.mulesoft.com/jp/pdk/1.4/policies-pdk-configure-features-streamproperties
source_site: docs.mulesoft.com
content_type: documentation
content_hash: bdef6f633bebc7afc2127b082e84775e1dc60c14ec7206ce18e387cec189e2f7
description: MuleSoft Documentation Site
release: "1.4"
latest: false
---
# ポリシー間のデータ共有

`StreamProperties`​ Injectable は、以下の目的のインターフェースを提供しています。

- 同じ要求を処理している他のポリシーによって設定されたプロパティをコンシュームする。
- プロパティをブロードキャストして、他のポリシーがコンシュームできるようにする。

データを共有するためには、​`StreamProperties`​ で ​`PropertyAccessor`​ trait を実装します。

```Rust
pub trait PropertyAccessor {
    fn read_property(&self, path: &[&str]) -> Option<Bytes>;
    fn set_property(&self, path: &[&str], value: Option<&[u8]>);
}
```

次の例は、ストリームからプロパティを読み取り、別のパラメーターを書き込む単純な検索条件を示しています。

```Rust
async fn request_filter(stream: StreamProperties) -> Flow<()> {
    let incoming = String::from_utf8(stream.read_property(&["incoming_property"]).unwrap_or_default()).unwrap_or_default();

    logger::info!("Recieved incoming prop {}", incoming);

    let outgoing = "outgoing".as_bytes();

    stream.set_property(&["outgoing_property"], Some(outgoing));

    Flow::Continue(())
}

#[entrypoint]
async fn configure(launcher: Launcher) -> Result<()> {
    let filter = on_request(|stream| request_filter(stream));
    launcher.launch(filter).await?;
    Ok(())
}
```

## [](#関連情報)関連情報

- [パラメーターの挿入](https://docs.mulesoft.com/jp/pdk/1.4/policies-pdk-configure-features-inject-parameters)