Skip to main content

publish_nats_json

Function publish_nats_json 

Source
pub(crate) async fn publish_nats_json(
    nc: &Client,
    reply: Subject,
    frame: &str,
    value: &Value,
) -> Result<()>
Expand description

Publishes a JSON export control frame on a NATS reply subject.

§Arguments

  • nc - Connected NATS client.
  • reply - Subject to publish to.
  • frame - Frame name written to the Avena-Export-Frame header.
  • value - JSON body of the message.

§Errors

Returns an error if value cannot be serialized or the publish fails.