Skip to main content
Version: 2.12

Create Consumer

Creates a new consumer.

Subject

$JS.API.CONSUMER.CREATE.{stream}.{consumer}

Where {stream} is the stream name and {consumer} is the consumer name (optional).

Request

A request to the JetStream $JS.API.CONSUMER.CREATE API

stream_namestringrequired
The name of the stream to create the consumer in
configobjectrequired
The consumer configuration
actionstring
The consumer create action
pedanticboolean
Enables pedantic mode where the server will not apply defaults or change the request
Default:false

Response

A response from the JetStream $JS.API.CONSUMER.CREATE API

One of the following:
Option 1 (object)
stream_namestringrequired
The Stream the consumer belongs to
namestringrequired
A unique name for the consumer, either machine generated or the durable name
tsstring<date-time>
The server time the consumer info was created
A point in time in RFC3339 format including timezone, though typically in UTC
configallOfrequired
createdstring<date-time>required
The time the Consumer was created
A point in time in RFC3339 format including timezone, though typically in UTC
deliveredobjectrequired
The last message delivered from this Consumer
ack_floorobjectrequired
The highest contiguous acknowledged message
num_ack_pendingintegerrequired
The number of messages pending acknowledgement
integer with a dynamic bit size depending on the platform the cluster runs on, can be up to 64bit
Minimum:0
Maximum:9223372036854776000
num_redeliveredintegerrequired
The number of redeliveries that have been performed
integer with a dynamic bit size depending on the platform the cluster runs on, can be up to 64bit
Minimum:0
Maximum:9223372036854776000
num_waitingintegerrequired
The number of pull consumers waiting for messages
integer with a dynamic bit size depending on the platform the cluster runs on, can be up to 64bit
Minimum:0
Maximum:9223372036854776000
num_pendingintegerrequired
The number of messages left unconsumed in this Consumer
unsigned 64 bit integer
Minimum:0
Maximum:18446744073709552000
clusterobject
push_boundboolean
Indicates if any client is connected and receiving messages from a push consumer
pausedboolean
Indicates if the consumer is currently in a paused state
pause_remaininginteger
When paused the time remaining until unpause
nanoseconds depicting a duration in time, signed 64 bit integer
Minimum:0
Maximum:9223372036854776000
priority_groupsobject[]
The state of Priority Groups
Option 2 (object)
errorobjectrequired
typeconst: "io.nats.jetstream.api.v1.consumer_create_response"required