Listener - rabbitmq : Listener

Public Ballerina API - Ballerina RabbitMQ Message Listener. To provide a listener to consume messages from RabbitMQ.

Constructor

__init

(ConnectionConfiguration | Connection connectionOrConnectionConfig, int? prefetchCount, int? prefetchSize)

  • 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

LifeCycle Methods

Methods

__gracefulStop

()

returns error?

__immediateStop

()

returns error?

Stops consuming messages through ChannelListener endpoint.

  • Return Type

    (error?)
  • Nil or error upon failure to close ChannelListener.

getChannel

()

returns Channel | error

Retrieve the Channel which initializes this listener.

  • Return Type

    (Channel | error)
  • RabbitMQ Channel object or error if an I/O problem is encountered.

LifeCycle Methods

__start

()

returns error?

Starts the endpoint. Function is ignored by the ChannelListener.

  • Return Type

    (error?)
  • Nil or error upon failure to start.

__attach

(service s, string? name)

returns error?

Binds the ChannelListener to a service.

Parameters

  • s service
  • Type descriptor of the service to bind to.

  • name string? - ()
  • Name of the service.

  • Return Type

    (error?)
  • () or error upon failure to register listener.