Clients -
nats :
StreamingProducer
NATS StreamingProducer would act as a client allowing to publish messages to the
NATS streaming server. StreamingProducer needs the NATS Connection to be initialized.
Constructor
__init
(Connection connection, string clientId, string clusterId, StreamingConfig? streamingConfig)
- connection Connection
-
An established NATS connection.
- clientId string ()
-
A unique identifier representing the client.
- clusterId string test-cluster
-
The ID of the cluster configured in the NATS server.
- streamingConfig StreamingConfig? ()
-
The configuration related to the NATS streaming connectivity.
Remote Methods
| publish | Publishes data to a given subject. |
Methods
Publishes data to a given subject.
-
Return Type
(string | Error) stringvalue representing the NUID (NATS Unique Identifier) of the published message, if the message gets successfully published and acknowledged by the NATS server ORnats/Errorwith NUID andmessagefields in case an error occurs in publishing, the timeout elapses while waiting for the acknowledgement ORnats/Erroronly with themessagefield in case an error occurs even before publishing is completed