Listener -
nats
: StreamingListener
Represents the NATS streaming server connection to which a subscription service should be bound in order to receive messages of the corresponding subscription.
Constructor
__init
(Connection connection, string? clientId, string clusterId, StreamingConfig? streamingConfig)
- connection Connection
-
An established NATS connection
- clientId string? <string?> ()
-
The unique identifier of the client. The
clientId
should be unique across all the subscriptions. Therefore, multilpe subscription services cannot be bound to a single listener
- clusterId string test-cluster
-
The unique identifier of the cluster configured in the NATS server. The default value is
test-cluster
- streamingConfig StreamingConfig? <ballerina/nats:StreamingConfig?> ()
-
The configuration related to the NATS streaming connectivity
Methods
nats:StreamingListener
.
nats:StreamingListener
gracefully.
nats:StreamingListener
forcefully.
LifeCycle Methods
Methods
nats:StreamingListener
.
Parameters
- s service
-
Type descriptor of the service
-
Return Type
(error?) ()
or else anats:Error
upon failure to detach the service
nats:StreamingListener
gracefully.
-
Return Type
(error?) ()
or else anats:Error
upon failure to stop the listener
nats:StreamingListener
forcefully.
-
Return Type
(error?) ()
or else anats:Error
upon failure to stop the listener
LifeCycle Methods
nats:StreamingListener
.
Parameters
- s service
-
Type descriptor of the service
- name string? (default <string?> ())
-
Name of the service
-
Return Type
(error?) ()
or else anats:Error
upon failure to register the listener