---
schema_version: "1"
id: 1b79f205b498e8b53d8f0aedf28489162104c0904cc4a7e8a28e2f53acd6f08c
title: Sharing Data Between Policies
collection: mulesoft
version: current
locale: en-us
portal_url: https://docs.salesforce.com/mulesoft/current/en-us/pdk/latest/policies-pdk-configure-features-streamproperties.md
canonical_url: https://docs.mulesoft.com/pdk/latest/policies-pdk-configure-features-streamproperties
source_site: docs.mulesoft.com
content_type: documentation
content_hash: 7326ac5ed4d0f780152842d791afedb0bfeae5d5a15e37668f2e2c4be05adaef
description: MuleSoft Documentation Site
release: "1.10"
latest: true
---
---
product: Omni Gateway Policy Development Kit (PDK)
version: 1.10
is-latest-version: true
---

# Sharing Data Between Policies

> For the full documentation index, see: https://docs.mulesoft.com/llms.txt

The `StreamProperties` injectable provides an interface to:

- Consume properties set by other policies that are processing the same request.

- Broadcast properties so that the other policies can consume them.

To share data, `StreamProperties` implements the `PropertyAccessor` trait:

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

The following example shows a simple filter that reads a property from the stream and then writes
another parameter to it:

```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(())
}
```

## See Also

- [Injecting Parameters](https://docs.mulesoft.com/pdk/latest/policies-pdk-configure-features-inject-parameters)
