Returns a stream's consumers, name-ordered, with delivery state.
Returns a stream's consumers, name-ordered, with delivery state.
GET /v1/mq/stream/{stream}/consumer
| Address | https://api.hanzo.ai/v1/mq/stream/{stream}/consumer |
| Method | GET |
| Operation | get_mq_stream_by_stream_consumer |
| Auth | Authorization: Bearer $HANZO_API_KEY |
Returns a stream's consumers, name-ordered, with delivery state.
Request
3 fields.
| Field | In | Type | Required | Description |
|---|---|---|---|---|
stream | path | string | yes | Stream is the stream name, from the path. |
limit | query | integer | — | Limit caps the consumers returned (1–1000, default 100). |
offset | query | integer | — | Offset skips that many consumers, name-ordered. |
Response
| Status | Body | Meaning |
|---|---|---|
200 | pickOut | ok |
200 body — 27 fields.
| Field | In | Type | Always | Description |
|---|---|---|---|---|
consumers | body | Consumer[] | — | Consumers is the page, ordered by name. |
consumers[].ack_floor | body | Sequences | — | |
consumers[].ack_floor.consumer_seq | body | integer | — | Consumer is the consumer's own sequence. |
consumers[].ack_floor.stream_seq | body | integer | — | Stream is the corresponding stream sequence. |
consumers[].config | body | Durable | — | |
consumers[].config.ack_policy | body | string | — | Ack is the acknowledgment policy: explicit (default), all, or none. |
consumers[].config.ack_wait | body | string | — | AckWait is how long the broker waits for an ack before redelivering, e.g. |
consumers[].config.deliver_policy | body | string | — | Deliver is where delivery starts: all (default), last, new, by_start_sequence, by_start_time, or last_per_subject. |
consumers[].config.description | body | string | — | Description says what this consumer is for. |
consumers[].config.durable_name | body | string | — | Name is the durable consumer name (alphanumeric, hyphens, underscores). |
consumers[].config.filter_subject | body | string | — | Filter delivers only messages on this org-relative subject (wildcards supported). |
consumers[].config.max_ack_pending | body | integer | — | MaxAckPending caps unacknowledged messages in flight (default 1000). |
consumers[].config.max_deliver | body | integer | — | MaxDeliver caps delivery attempts per message; -1 (default) is unlimited. |
consumers[].config.opt_start_seq | body | integer | — | StartSeq is the starting sequence for deliver_policy by_start_sequence. |
consumers[].config.opt_start_time | body | string (date-time) | — | StartTime is the starting instant for deliver_policy by_start_time. |
consumers[].config.replay_policy | body | string | — | Replay is the replay pacing: instant (default) or original. |
consumers[].created | body | string (date-time) | — | Created is when the consumer was created. |
consumers[].delivered | body | Sequences | — | |
consumers[].delivered.consumer_seq | body | integer | — | Consumer is the consumer's own sequence. |
consumers[].delivered.stream_seq | body | integer | — | Stream is the corresponding stream sequence. |
consumers[].name | body | string | — | Name is the consumer name. |
consumers[].num_ack_pending | body | integer | — | AckPending is the number of delivered, not yet acknowledged messages. |
consumers[].num_pending | body | integer | — | Pending is the number of messages yet to be delivered. |
consumers[].num_redelivered | body | integer | — | Redelivered is the number of messages currently being redelivered. |
consumers[].num_waiting | body | integer | — | Waiting is the number of pull requests waiting for messages. |
consumers[].stream_name | body | string | — | Stream is the stream this consumer reads. |
total | body | integer | — | Total is the stream's consumer count before paging. |
Failure carries the platform error shape — see Errors.
Examples
hanzo has no subcommand for this operation — the CLI serves only what cloud's live route table confirms. Use HTTP or an SDK.
import { Configuration, MqApi } from 'hanzoai';
const api = new MqApi(new Configuration({ accessToken: process.env.HANZO_API_KEY }));
const { data } = await api.getMqStreamByStreamConsumer({ stream: 'stream' });from hanzoai.cloud import ApiClient, Configuration
from hanzoai.cloud.api import MqApi
client = ApiClient(Configuration(access_token=os.environ["HANZO_API_KEY"]))
result = MqApi(client).get_mq_stream_by_stream_consumer(stream='stream')cfg := cloud.NewConfiguration()
cfg.AddDefaultHeader("Authorization", "Bearer "+os.Getenv("HANZO_API_KEY"))
client := cloud.NewAPIClient(cfg)
resp, _, err := client.MqAPI.GetMqStreamByStreamConsumer(context.Background()).Execute()
if err != nil {
return err
}use hanzo_cloud::apis::{configuration::Configuration, mq_api};
let mut cfg = Configuration::new();
cfg.bearer_access_token = std::env::var("HANZO_API_KEY").ok();
let result = mq_api::get_mq_stream_by_stream_consumer(&cfg, Default::default()).await?;import ai.hanzo.cloud.ApiClient;
import ai.hanzo.cloud.api.MqApi;
ApiClient client = new ApiClient();
client.setRequestInterceptor(b -> b.header("Authorization", "Bearer " + System.getenv("HANZO_API_KEY")));
var result = new MqApi(client).getMqStreamByStreamConsumer();The method above is the one at the current release of the document. [email protected] (npm) and [email protected] (PyPI) were generated from an earlier release, where this operation carried a different id, so it spells the method differently — regenerating the clients is what makes the two agree. SDKs →
curl https://api.hanzo.ai/v1/mq/stream/<stream>/consumer \
-H "Authorization: Bearer $HANZO_API_KEY"The door reaches mq through the mq tool, which names its 15 operations with its own verbs — this one among them, under a name only the door declares. describe explains any of them:
curl -X POST https://api.hanzo.ai/v1/mcp \
-H "Content-Type: application/json" \
-d '{
"jsonrpc": "2.0",
"id": 1,
"method": "tools/call",
"params": {
"name": "describe",
"arguments": {
"op": "get_mq_health"
}
}
}'How is this guide?