Object - rabbitmq : Connection

Represents a single network connection to the RabbitMQ broker.

close

(int closeCode, string closeMessage, int timeoutInMillis)

returns Error?

Closes the RabbitMQ Connection and all it's Channels. It waits with a provided timeout for all the close operations to complete. When timeout is reached the socket is forced to 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?)
  • An error if an I/O problem is encountered.

abortConnection

Aborts the RabbitMQ Connection and all its Channels. Forces the Connection to close and waits for all the close operations to complete. When timeout is reached the socket is forced to close. Any encountered exceptions in the close operations are silently discarded.

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.

  • Return Type

    (boolean)
  • The value true if the Connection is already closed and false otherwise.