Clients
-
nats
:
StreamingProducer
The streaming producer provides the capability to publish messages to the NATS streaming server.
The nats:StreamingProducer needs the nats:Connection to be initialized.
Isolated Function
Publishes data to a given subject.
ballerina string|error result = producer->publish(subject, <@untainted>message);
-
Return Type
(string | Error) The
stringvalue representing the NUID (NATS Unique Identifier) of the published message if the message gets successfully published and acknowledged by the NATS server, anats:Errorwith NUID andmessagefields in case an error occurs in publishing, the timeout elapses while waiting for the acknowledgement, or else anats:Erroronly with themessagefield in case an error occurs even before publishing is completed