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. If the value is less than 1, the request waits the minimum time of 1 second.

When absent, the request waits the default interval.

matcher=json_content_matcher Required for last-value durables.

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

type=durable_type Required if the durable subscription was originally created using the durable type parameter (via POST REST request).

If required, specify a durable type of either shared or last-value.

max=maximum_messages_to_return Optional.

When present, the number of messages returned is limited by the value specified.

When absent, the request returns all messages in the durable, up to a maximum of 100 messages.

Example Requests

curl http://localhost:8585/channel201/v1/subscribe/durableA3?timeout=10
curl http://localhost:8585/channel201/v1/subscribe/durableA3?type=shared
curl http://localhost:8585/channel201/v1/subscribe/LastValDurableA3?type=last-value&key=symbol&matcher='\{"symbol":"amzn"}'

Example Response

{
  "messages":[
    {
      "symbol":"amzn",
      "bid":1732
    }
  ]
}

Subscribing on EMS Channels

When subscribing on an EMS channel, you must supply the topic name in the matcher parameter of the request. For example:
curl http://host:port/chan_name/v1/subscribe/lv_dur_name?matcher='\{"_dest":"symbol.amzn"\}'