This function is used to create a JetStream consumer.
Context
Windows client
Windows server
Java client
Java server
Adelia Web Client
Adelia Cloud client
Event Adelia client
Parameters
NUM_BIN_4
| Handle | Connection ID |
ALPHA | Stream | Stream name. |
ALPHA
| Consumer | Name of consumer (durable). If this parameter is not specified, the created consumer will be ephemeral and will have a name assigned by the system. Input/output parameter. |
ALPHA | Options | Consumer parameters in the form of a list of key/value pairs separated by semi-colons.
The accepted options are:
description |
Consumer description |
deliverPolicy |
Delivery policy (all, last, new, by_start_sequence, by_start_time, last_per_subject) |
ackPolicy |
Acknowledgment policy (none, all, explicit) |
replayPolicy |
Replay policy (original, instant) |
name |
Used to assign a name to the consumer. Must be the same as the "consumerName" parameter value if this is specified. NATS 2.9 or later is required. |
deliverSubject |
Delivery subject |
deliverGroup
|
Delivery group |
sampleFrequency |
Sample frequency (string) |
startTime |
Start date in the form of an ISO timestamp with time zone (e.g. 2007-12-03T10:15Z or 2007-12-03T11:15+01:00). |
ackWait |
Acknowledgment wait time in milliseconds (0 by default) |
idleHeartbeat |
Idle message wait time in milliseconds (0 by default) |
maxExpires |
Maximum expiration time in milliseconds for a "pull" request (0 by default) |
inactiveThreshold |
Wait time in milliseconds before the consumer is considered inactive (0 by default) |
startSequence |
Consumer start sequence number (0 by default) |
maxDeliver |
Maximum number of messages delivered to the consumer (0 by default) |
rateLimit |
Rate limit in bits per second (0 by default) |
maxAckPending |
Maximum number of pending acknowledgments (0 by default) |
maxPullWaiting |
Maximum number of pending pulls (0 by default) |
maxBatch |
Maximum size of a batch for a pull request (0 by default) |
maxBytes |
Maximum data size (in bytes) for a pull request (0 by default) |
numReplicas |
Maximum number of replicas (0 by default) |
flowControl |
Enables stream control and defines the idle heartbeat time (0 by default). |
headersOnly |
Transmits message headers only. Boolean. By default: false. |
memStorage |
Forces the storage of the consumer's state in memory instead of inheriting the stream configuration. Boolean. By default: false. |
backoff |
List of times in the form of a list of integer numbers separated by commas. Overloads the ackWait parameter. |
metadata |
Consumer metadata List of key/value pairs separated by commas. |
filterSubjects |
List of subjects to filter in the consumer |
|
NUM_BIN_4
| Rc | Function return code. The possible values are provided in NatsLastError function documentation. Output parameter. |
Example
CALL_DLL 'NatsToolBx' 'NatsCreateConsumer' Handle 'ORDERS' 'Orders' 'description: order consumption; durable: Orders; ackPolicy: all' Rc
↑ Top of page