Subscribe to PubNub Channel and Receive Messages
subscribe_and_receive_pubnub_messagesSubscribe to a PubNub channel to receive a configurable number of real-time messages within a specified timeout.
Instructions
Subscribe to a PubNub channel and receive messages in real-time. Specify the number of messages (default 1) and/or a timeout (default 10s, max 30s) to wait for. Requires publish and subscribe keys from your PubNub keyset.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| channel | Yes | Channel ID to subscribe to and receive messages from | |
| messageCount | No | Number of messages to wait for before unsubscribing (default: 1 message) | |
| timeout | No | Maximum timeout in seconds. If not all messages are received within this time, the subscription will end (default: 10 seconds, max 30 seconds) | |
| publishKey | Yes | Publish Key that can be obtained from your keyset by manage_keysets tool with parameter operation list or in PubNub admin portal | |
| subscribeKey | Yes | Subscribe Key that can be obtained from your keyset by manage_keysets tool with parameter operation list or in PubNub admin portal |