List consumer

Returns a stream's consumers, name-ordered, with delivery state.

GET /v1/mq/stream/{stream}/consumer

Addresshttps://api.hanzo.ai/v1/mq/stream/{stream}/consumer
MethodGET
Operationget_mq_stream_by_stream_consumer
AuthAuthorization: Bearer $HANZO_API_KEY

Returns a stream's consumers, name-ordered, with delivery state.

Request

3 fields.

FieldInTypeRequiredDescription
streampathstringyesStream is the stream name, from the path.
limitqueryinteger—Limit caps the consumers returned (1–1000, default 100).
offsetqueryinteger—Offset skips that many consumers, name-ordered.

Response

StatusBodyMeaning
200mq.pickOutok
defaultproblem-detailsrefused

200 body — 27 fields.

FieldInTypeAlwaysDescription
consumersbodymq.Consumer[]—Consumers is the page, ordered by name.
consumers[].ack_floorbodymq.Sequences—
consumers[].ack_floor.consumer_seqbodyinteger (uint64)—Consumer is the consumer's own sequence.
consumers[].ack_floor.stream_seqbodyinteger (uint64)—Stream is the corresponding stream sequence.
consumers[].configbodymq.Durable—
consumers[].config.ack_policybodystring—Ack is the acknowledgment policy: explicit (default), all, or none.
consumers[].config.ack_waitbodystring—AckWait is how long the broker waits for an ack before redelivering, e.g. "30s" (default).
consumers[].config.deliver_policybodystring—Deliver is where delivery starts: all (default), last, new, by_start_sequence, by_start_time, or last_per_subject.
consumers[].config.descriptionbodystring—Description says what this consumer is for.
consumers[].config.durable_namebodystring—Name is the durable consumer name (alphanumeric, hyphens, underscores).
consumers[].config.filter_subjectbodystring—Filter delivers only messages on this org-relative subject (wildcards supported).
consumers[].config.max_ack_pendingbodyinteger (int64)—MaxAckPending caps unacknowledged messages in flight (default 1000).
consumers[].config.max_deliverbodyinteger (int64)—MaxDeliver caps delivery attempts per message; -1 (default) is unlimited.
consumers[].config.opt_start_seqbodyinteger (uint64)—StartSeq is the starting sequence for deliver_policy by_start_sequence.
consumers[].config.opt_start_timebodystring (date-time)—StartTime is the starting instant for deliver_policy by_start_time.
consumers[].config.replay_policybodystring—Replay is the replay pacing: instant (default) or original.
consumers[].createdbodystring (date-time)—Created is when the consumer was created.
consumers[].deliveredbodymq.Sequences—
consumers[].delivered.consumer_seqbodyinteger (uint64)—Consumer is the consumer's own sequence.
consumers[].delivered.stream_seqbodyinteger (uint64)—Stream is the corresponding stream sequence.
consumers[].namebodystring—Name is the consumer name.
consumers[].num_ack_pendingbodyinteger (int64)—AckPending is the number of delivered, not yet acknowledged messages.
consumers[].num_pendingbodyinteger (uint64)—Pending is the number of messages yet to be delivered.
consumers[].num_redeliveredbodyinteger (int64)—Redelivered is the number of messages currently being redelivered.
consumers[].num_waitingbodyinteger (int64)—Waiting is the number of pull requests waiting for messages.
consumers[].stream_namebodystring—Stream is the stream this consumer reads.
totalbodyinteger (int64)—Total is the stream's consumer count before paging.

Failure carries the platform error shape — see Errors.

Examples

hanzo mq stream consumer list <stream>
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 := hanzoai.NewConfiguration()
cfg.AddDefaultHeader("Authorization", "Bearer "+os.Getenv("HANZO_API_KEY"))
client := hanzoai.NewAPIClient(cfg)

resp, _, err := client.MqAPI.GetMqStreamByStreamConsumer(context.Background()).Execute()
if err != nil {
	return err
}
use hanzo_client::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.setBearerToken(System.getenv("HANZO_API_KEY"));

var result = new MqApi(client).getMqStreamByStreamConsumer();
curl https://api.hanzo.ai/v1/mq/stream/<stream>/consumer \
  -H "Authorization: Bearer $HANZO_API_KEY"

Tool mq, op get_mq_stream_by_stream_consumer — POST the JSON-RPC envelope to https://api.hanzo.ai/v1/mcp.

curl -X POST https://api.hanzo.ai/v1/mcp \
  -H "Authorization: Bearer $HANZO_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
       "jsonrpc": "2.0",
       "id": 1,
       "method": "tools/call",
       "params": {
         "name": "mq",
         "arguments": {
           "op": "get_mq_stream_by_stream_consumer",
           "input": {
             "stream": "<stream>"
           }
         }
       }
     }'

MQ API · All Hanzo APIs · Interactive reference

Was this page useful?