Get consumer

Returns one consumer's configuration and delivery state.

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

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

Returns one consumer's configuration and delivery state.

Request

2 fields.

FieldInTypeRequiredDescription
streampathstringyesStream is the stream name, from the path.
namepathstringyesName is the consumer name, from the path.

Response

StatusBodyMeaning
200mq.Consumerok
defaultproblem-detailsrefused

200 body — 25 fields.

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

Failure carries the platform error shape — see Errors.

Examples

hanzo mq stream consumer get <stream> <name>
import { Configuration, MqApi } from 'hanzoai';

const api = new MqApi(new Configuration({ accessToken: process.env.HANZO_API_KEY }));
const { data } = await api.getMqStreamByStreamConsumerByName({ stream: 'stream', name: 'name' });
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_by_name(stream='stream', name='name')
cfg := hanzoai.NewConfiguration()
cfg.AddDefaultHeader("Authorization", "Bearer "+os.Getenv("HANZO_API_KEY"))
client := hanzoai.NewAPIClient(cfg)

resp, _, err := client.MqAPI.GetMqStreamByStreamConsumerByName(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_by_name(&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).getMqStreamByStreamConsumerByName();
curl https://api.hanzo.ai/v1/mq/stream/<stream>/consumer/<name> \
  -H "Authorization: Bearer $HANZO_API_KEY"

Tool mq, op get_mq_stream_by_stream_consumer_by_name — 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_by_name",
           "input": {
             "stream": "<stream>",
             "name": "<name>"
           }
         }
       }
     }'

MQ API · All Hanzo APIs · Interactive reference

Was this page useful?