Set Message Queue
This page shows you several ways to use a stream as a message queue.
To use a stream as a message queue:
- Establish a shared subscription and use the same subscription name as the other consumers.
- Set the receiver queue for the consumers.
When you subscribe to a stream, use the following configuration settings depending on your SDK:
- JavaScript SDK
- Python SDK
// Create subscriber
stream.consumer("my-subscription", "test.macrometa.io", {
subscriptionType: Shared,
receiverQueueSize: 1000,
}
# Create subscriber
subscriber = client.subscribe(
stream="quickStart", local=False, subscription_name="sub_1", consumer_type=CONSUMER_TYPES.SHARED, receiver_queue_size=1000
)