Skip to main content
Deno 2 is finally here 🎉️
Learn more
Go to Latest
interface ConsumerOpts
import { type ConsumerOpts } from "https://deno.land/x/natsws@v1.28.0/src/mod.ts";

Properties

config: Partial<ConsumerConfig>

The consumer configuration

mack: boolean

Enable manual ack. When set to true, the client is responsible to ack messages.

stream: string

The name of the stream

optional
callbackFn: JsMsgCallback

An optional callback to process messages - note that iterators are the preferred way of processing messages.

optional
name: string

The consumer name

ordered: boolean

Only applicable to push consumers. When set to true, the consumer will be an ordered consumer.

optional
max: number

Standard option for all subscriptions. Defines the maximum number of messages dispatched by the server before stopping the subscription. For JetStream this may not be accurate as JetStream can add additional protocol messages that could count towards this limit.

optional
queue: string

Only applicable to push consumers, allows the pull subscriber to horizontally load balance.

optional
isBind: boolean

If true, the client will only attempt to bind to the specified consumer name/durable on the specified stream. If the consumer is not found, the subscribe will fail