Directions assigned to method parameters:
(I) |
Input |
(O) |
Output |
List of return codes for the various methods:
_NATS_ERR_OK | Method run successfully. |
_NATS_ERR_ERROR | An unexpected error occurred. |
_NATS_ERR_INVALID_PARAMETER | Invalid parameter. |
_NATS_ERR_NOT_CONNECTED | Not connected. |
Message acknowledgment. This method can only be called when processing the OnMessage event.
Syntax | ||||||||||
CALL_METHOD ObjectName ACK_MESSAGE Mode Time ReturnCode |
||||||||||
Parameters |
||||||||||
Mode (I) |
NUM_BIN_4 |
Acknowledgment mode. Possible values:
|
||||||||
Mode (I) |
NUM_BIN_4 |
NATS subject. | ||||||||
ReturnCode (O) |
BOOL |
Method's return code. |
Connection to NATS.
Syntax | ||||||||||||||||||
CALL_METHOD, ObjectName, CONNECT Urls Options ReturnCode |
||||||||||||||||||
Parameters |
||||||||||||||||||
Urls (I) |
ALPHA(n) |
List of NATS access URLs, separated by the ";" character. If the parameter is empty, a connection is made to the local server (nats://localhost:4222). |
||||||||||||||||
Options (I) |
ALPHA(n) |
List of connection options in the form of a set of key/value pairs with the ":" character separating the key from the value and the ";" character separating the options. The accepted options are:
|
||||||||||||||||
ReturnCode (O) |
NUM_BIN_4 |
Method's return code. |
Counts the number of values associated with a header. This method can only be called when processing the OnMessage event.
Syntax | ||
CALL_METHOD ObjectName COUNT_HEADER_VALUES HeaderName ValuesNumber |
||
Parameters |
||
HeaderName (O) |
ALPHA(250) |
Header name. |
ValuesNumber (O) |
NUM_BIN_4 |
Number of values associated with the header. |
Counts the headers associated with a message. This method can only be called when processing the OnMessage event.
Syntax | ||
CALL_METHOD ObjectName COUNT_HEADERS HeadersNumber |
||
Parameters |
||
HeadersNumber (O) |
NUM_BIN_4 |
Number of headers associated with the message. |
Disconnecting from NATS. This method has no effect if you are not currently connected.
Syntax | ||
CALL_METHOD ObjectName DISCONNECT |
Retrieves the name of the nth header of a message. This method can only be called when processing the OnMessage event.
Syntax | ||
CALL_METHOD ObjectName GET_HEADER_NAME HeaderNumber HeaderName |
||
Parameters |
||
HeaderNumber (I) |
NUM_BIN_4 |
Header number. |
HeaderName (O) |
ALPHA(250) |
Header name. |
Counts the number of values associated with a header. This method can only be called when processing the OnMessage event.
Syntax | ||
CALL_METHOD ObjectName GET_HEADER_VALUE HeaderName ValueNumber HeaderValue |
||
Parameters |
||
HeaderName (O) |
ALPHA(250) |
Header name. |
ValueNumber (O) |
NUM_BIN_4 |
Value number. |
HeaderValue (O) |
ALPHA(250) |
Value of the nth header. |
Send a message to a NATS subject.
Syntax | ||
CALL_METHOD, ObjectName SEND_MESSAGE Subject ReplyTo Headers Message ReturnCode |
||
Parameters |
||
Subject (I) |
ALPHA(250) |
NATS subject. |
ReplyTo (I) |
ALPHA(250) |
Subject to receive a response. |
Headers (I) |
ALPHA(n) |
List of headers for the message in the form of a set of key/value pairs with the ":" character separating the header name from the value and the ";" character separating the headers. Several values can be provided for a header by separating them with the "," character. If the "," or ";" characters need to appear in a header value, you need to replace them with the following escape characters respectively: %2c and %3b. |
Message (I) |
ALPHA(n) or IMAGE |
Message body. If the body is an alphanumeric variable, it is converted into UTF-8. |
ReturnCode (O) |
NUM_BIN_4 |
Method's return code. |
Subscribing to a NATS subject.
Syntax | ||||||||||||||||||||||||||||||||||||
CALL_METHOD ObjectName SUBSCRIBE Subject MaxNoMessages SubscriptionType Options ReturnCode |
||||||||||||||||||||||||||||||||||||
Parameters |
||||||||||||||||||||||||||||||||||||
Subject (I) |
ALPHA(250) |
NATS subject. | ||||||||||||||||||||||||||||||||||
MaxNoMessages (I) |
NUM_BIN_4 |
Maximum number of messages to read. If MaxNoMessages is > 0, the subscriber will stop automatically after reading MaxNoMessages messages. | ||||||||||||||||||||||||||||||||||
SubscriptionType (I) |
NUM_BIN_4 |
Subscription type.
|
||||||||||||||||||||||||||||||||||
Options (I) |
ALPHA(n) |
List of options for subscribers in the form of a set of key/value pairs with the : character separating the key from the value and the ; character separating the options. NATS Core subscribers only accept the "queue" option. The accepted options are:
|
||||||||||||||||||||||||||||||||||
ReturnCode (O) |
NUM_BIN_4 |
Method's return code. |
Cancels the subscription to a NATS subject.
Syntax | ||
CALL_METHOD ObjectName UNSUBSCRIBE Subject ReturnCode |
||
Parameters |
||
Subject (I) |
ALPHA(250) |
NATS subject. |
ReturnCode (O) |
NUM_BIN_4 |
Method's return code. |