---
schema_version: "1"
id: 1f6601398bd52ed10b6d67a2c7df07c518d412abdb75eb2c7c6c6de429dc9e3d
title: ポリシー間のデータ共有
collection: mulesoft
version: current
locale: ja-jp
portal_url: https://docs.salesforce.com/mulesoft/current/ja-jp/pdk/1.2/policies-pdk-configure-features-streamproperties.md
canonical_url: https://docs.mulesoft.com/jp/pdk/1.2/policies-pdk-configure-features-streamproperties
source_site: docs.mulesoft.com
content_type: documentation
content_hash: 2f029ff16d02e21f5610b0dbd501f0bf13e1bcb4fd378e265ebd5fb21a5b7c5f
description: MuleSoft Documentation Site
release: "1.2"
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.2/policies-pdk-configure-features-inject-parameters)