$JS.API.STREAM.LIST
is represented by api.JSApiStreamList
constant in the nats-server source. Tables below will reference these constants and payload related data structures.type
which can be used to find the JSON Schema for each response.-ERR
or +OK
with an optional reason after.nats
CLI can do falls in the sections below. The API structure are kept in the api
package in the jsm.go
repository.T
like api.JSApiConsumerCreateT
are formats and would need to have the Stream Name and in some cases also the Consumer name interpolated into them. In this case t := fmt.Sprintf(api.JSApiConsumerCreateT, streamName)
to get the final subject.nats events
will show you an audit log of all API access events which includes the full content of each admin request, use this to view the structure of messages the nats
command sends.type
field which indicates their Schema. A JSON Schema repository can be found in nats-io/jsm.go/schemas
.$JS.API.INFO
api.JSApiAccountInfo
api.JetStreamAccountStats
$JS.API.STREAM.LIST
api.JSApiStreamList
api.JSApiStreamListRequest
api.JSApiStreamListResponse
$JS.API.STREAM.NAMES
api.JSApiStreamNames
api.JSApiStreamNamesRequest
api.JSApiStreamNamesResponse
$JS.API.STREAM.CREATE.*
api.JSApiStreamCreateT
api.StreamConfig
api.JSApiStreamCreateResponse
$JS.API.STREAM.UPDATE.*
api.JSApiStreamUpdateT
api.StreamConfig
api.JSApiStreamUpdateResponse
$JS.API.STREAM.INFO.*
api.JSApiStreamInfoT
api.JSApiStreamInfoResponse
$JS.API.STREAM.DELETE.*
api.JSApiStreamDeleteT
api.JSApiStreamDeleteResponse
$JS.API.STREAM.PURGE.*
api.JSApiStreamPurgeT
api.JSApiStreamPurgeResponse
$JS.API.STREAM.MSG.DELETE.*
api.JSApiMsgDeleteT
api.JSApiMsgDeleteRequest
api.JSApiMsgDeleteResponse
$JS.API.STREAM.MSG.GET.*
api.JSApiMsgGetT
api.JSApiMsgGetRequest
api.JSApiMsgGetResponse
$JS.API.STREAM.SNAPSHOT.*
api.JSApiStreamSnapshotT
api.JSApiStreamSnapshotRequest
api.JSApiStreamSnapshotResponse
$JS.API.STREAM.RESTORE.*
api.JSApiStreamRestoreT
{}
api.JSApiStreamRestoreResponse
$JS.API.CONSUMER.CREATE.*
api.JSApiConsumerCreateT
api.ConsumerConfig
, Stream name in subjectapi.JSApiConsumerCreateResponse
$JS.API.CONSUMER.DURABLE.CREATE.*.*
api.JSApiDurableCreateT
api.ConsumerConfig
, Stream name in subjectapi.JSApiConsumerCreateResponse
$JS.API.CONSUMER.LIST.*
api.JSApiConsumerListT
api.JSApiConsumerListRequest
api.JSApiConsumerListResponse
$JS.API.CONSUMER.NAMES.*
api.JSApiConsumerNamesT
api.JSApiConsumerNamesRequest
api.JSApiConsumerNamesResponse
$JS.API.CONSUMER.INFO.*.*
api.JSApiConsumerInfoT
api.JSApiConsumerInfoResponse
$JS.API.CONSUMER.DELETE.*.*
api.JSApiConsumerDeleteT
api.JSApiConsumerDeleteResponse
$JS.ACK.ORDERS.test.1.2.2
, this is the prefix defined in api.JetStreamAckPre
followed by <stream>.<consumer>.<delivered count>.<stream sequence>.<consumer sequence>.<timestamp>.<pending messages>
.msg.Respond(nil)
(or language equivalent) which will send nil to the reply subject.$JS.API.CONSUMER.MSG.NEXT.<stream>.<consumer>
, here the format is defined in api.JetStreamRequestNextT
and requires populating using fmt.Sprintf()
.nats req
only shows 1 - but you can fetch a batch of messages by varying the argument. This combines well with the AckAll
Ack policy.Status
header of 404
, this way you can know when you reached the end of the stream for example. A 409
is returned if the Consumer has reached MaxAckPending
limits.$JS.API.STREAM.MSG.GET.ORDERS
sending it the message sequence as payload. Here the prefix is defined in api.JetStreamMsgBySeqT
which also requires populating using fmt.Sprintf()
.$JS.EVENT.METRIC.CONSUMER_ACK.<stream>.<consumer>
you can just subscribe to that and get api.ConsumerAckMetric
messages in JSON format. The prefix is defined in api.JetStreamMetricConsumerAckPre
.