GET chan_name/v1/subscribe/dur_name

The web method GET chan_name/v1/subscribe/dur_name gets zero or more messages from a specific durable subscription on a specific channel.

  • chan_name in the URI is the channel name.
  • dur_name in the URI is the durable name of the subscription.

One common usage pattern would be to repeat this request until the response array is empty, indicating that no messages remain in the durable.

HTTP Parameters

Syntax Description
timeout=wait_time Optional.

When present, the request waits this interval (in seconds) for messages to become available.

When absent or zero, the request returns immediately, even if no messages are available in the durable.

matcher=json_content_matcher Required for last-value durables.

Specify a content matcher that includes the key field of a last-value durable.

Example Requests

curl GET http://host:port/chan_name/v1/subscribe/dur_name?timeout=10
curl GET http://host:port/chan_name/v1/subscribe/lv_dur_name?matcher='\{"symbol":"amzn"\}'

Example Response

{
  "messages":[
    {
      "symbol":"amzn",
      "bid":1732
    }
  ],
  "error":{
    "code":0,
    "reason":""
  }
}