Object - rabbitmq : Connection

Represents a single network connection to the RabbitMQ broker.

Constructor

__init

(ConnectionConfiguration connectionConfiguration)

Methods

Closes the rabbitmq:Connection and all its rabbitmq:Channels. It waits with a provided timeout for all the close operations to complete. When the timeout is reached, the socket is forced to close.
 rabbitmq:Error? closeResult = newConnection.close();
Aborts the rabbitmq:Connection and all its rabbitmq:Channels. Forces the rabbitmq:Connection to close and waits for all the close operations to complete. When the timeout is reached, the socket is forced to close. Any encountered exceptions in the close operations are discarded silently.
 connection.abortConnection(320, "Channel Aborted");
Checks whether close was already called.
 boolean closed = newConnection.isClosed();

close

(int? closeCode, string? closeMessage, int? timeoutInMillis)

returns Error?
Closes the rabbitmq:Connection and all its rabbitmq:Channels. It waits with a provided timeout for all the close operations to complete. When the timeout is reached, the socket is forced to close.
 rabbitmq:Error? closeResult = newConnection.close();

Parameters

  • closeCode int? (default ())
  • The close code (for information, go to the "Reply Codes" section in the [AMQP 0-9-1 specification] (#https://www.rabbitmq.com/resources/specs/amqp0-9-1.pdf))

  • closeMessage string? (default ())
  • A message indicating the reason for closing the connection

  • timeoutInMillis int? (default ())
  • Timeout (in milliseconds) for completing all the close-related operations. Use -1 for infinity

  • Return Type

    (Error?)
  • A rabbitmq:Error if an I/O error is encountered or else ()

abortConnection

Aborts the rabbitmq:Connection and all its rabbitmq:Channels. Forces the rabbitmq:Connection to close and waits for all the close operations to complete. When the timeout is reached, the socket is forced to close. Any encountered exceptions in the close operations are discarded silently.
 connection.abortConnection(320, "Channel Aborted");

Parameters

  • closeCode int? (default ())
  • The close code (for information, go to the "Reply Codes" section in the [AMQP 0-9-1 specification] (#https://www.rabbitmq.com/resources/specs/amqp0-9-1.pdf))

  • closeMessage string? (default ())
  • A message indicating the reason for closing the connection

  • timeoutInMillis int? (default ())
  • Timeout (in milliseconds) for completing all the close-related operations. Use -1 for infinity

isClosed

()

returns boolean
Checks whether close was already called.
 boolean closed = newConnection.isClosed();
  • Return Type

    (boolean)
  • The value true if the rabbitmq:Connection is already closed or else false