Publish Data

Catalyst Data Streams enables you to publish real-time data to a channel. Any active subscribers connected to that channel will receive the published data instantly through their WebSocket connections.

You can publish data to a channel by passing the channel ID and the data payload to the publish_data() method. The data_streams reference used below is the component instance created earlier. To know more about this instance, please refer to this section.

Parameters Used

Parameter Name Data Type Definition
channel_id String A Mandatory parameter. Holds the unique ID of the channel.
data Object A Mandatory parameter. Holds the data payload to be published to the channel.
copy
# Publish a message to all subscribers of the channel
publish_response = data_streams.publish_data("CHANNEL_ID", "Hello, subscribers!")

Last Updated 2026-10-05 20:43:57 +0530 IST

ON THIS PAGE