This function is used to create a subscription to a NATS subject. Messages must be consumed synchronously.
Only subscription to a JetStream consumer is possible with the NATS toolbox. Synchronous consumption of core NATS messages is not possible so the NATS graphical object is needed.
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 | Subject | NATS subject |
NUM_BIN_4
| SubscriptionType | Subscription type
_NATS_CONS_TYPE_PUSH |
JetStream PUSH consumer |
_NATS_CONS_TYPE_PULL |
JetStream PULL consumer |
|
|
|
ALPHA | Options | List of options for JetStream subscribers in the form of a list of key/value pairs separated by semi-colons.
The accepted options are:
name |
Consumer’s name |
stream |
Name of NATS stream |
durable |
Name of consumer durable |
bind |
Bind to an existing consumer (name must reference the consumer's name). Ignored in the Windows version. |
messageAlarmTime |
Wait time between two messages or heartbeats before triggering an error. Not supported in the Windows version. |
ordered |
Ordered message delivery (PUSH only) |
deliverSubject |
Recipient subject (PUSH only) |
deliverGroup |
Recipient group (PUSH only). Must match the "queue" parameter if both are specified. |
pendingMessageLimit |
Maximum number of pending messages (PUSH only). Not supported in the Windows version. |
pendingByteLimit |
Maximum size of pending messages (PUSH only). Not supported in the Windows version. |
queue |
Queue to use (PUSH only) |
fastBind |
Fast bind. The consumer parameter match is not validated (PULL only). Ignored in the Windows version. |
|
|
|
NUM_BIN_4
| Rc | Function return code. The possible values are provided in NatsLastError function documentation. Output parameter. |
Example
CALL_DLL 'NatsToolBx' 'NatsSubscrible' Handle 'orders.france' 'durable: Orders' Rc
↑ Top of page