Listener -
rabbitmq
: Listener
Ballerina RabbitMQ Message Listener. Provides a listener to consume messages from the RabbitMQ server.
Constructor
__init
(ConnectionConfiguration | Connection connectionOrConnectionConfig, int? prefetchCount, int? prefetchSize)
- connectionOrConnectionConfig ConnectionConfiguration | Connection
-
Holds a Ballerina RabbitMQ
Connection
object or the connection parameters.
- prefetchCount int? ()
-
Maximum number of messages that the server will deliver, 0 if unlimited. Unless explicitly given, this value is 10 by default.
- prefetchSize int? ()
-
Maximum amount of content (measured in octets) that the server will deliver, 0 if unlimited.
Methods
Stops consuming messages and detaches the service from the Listener
endpoint.
Stops consuming messages through all consumer services by terminating the connection and all its channels.
Stops consuming messages through all consumer services and terminate the connection with the server.
Retrieve the Channel
which initializes this Listener
.
LifeCycle Methods
Methods
Stops consuming messages and detaches the service from the Listener
endpoint.
Parameters
- s service
-
Type descriptor of the service to bind to.
-
Return Type
(error?) Nil or error upon failure to detach service.
Stops consuming messages through all consumer services by terminating the connection and all its channels.
-
Return Type
(error?) Nil or error upon failure to close the
ChannelListener
Stops consuming messages through all consumer services and terminate the connection with the server.
-
Return Type
(error?) Nil or error upon failure to close ChannelListener.
Retrieve the Channel
which initializes this Listener
.
-
Return Type
(Channel) RabbitMQ Channel object or error if an I/O problem is encountered.
LifeCycle Methods
Attaches the service to the Listener
endpoint.
Parameters
- s service
-
Type descriptor of the service to bind to.
- name string? (default ())
-
Name of the service.
-
Return Type
(error?) Nil or error upon failure to register service.