Connection

class amqpstorm.UriConnection(uri, lazy=False)[source]

Create a new Connection instance using an AMQP Uri string.

Usage:

UriConnect(‘amqp://guest:guest@localhost:5672/%2F?heartbeat=60’)

UriConnect(‘amqps://guest:guest@localhost:5671/%2F?heartbeat=60’)

class amqpstorm.Connection(hostname, username, password, port=5672, **kwargs)[source]

RabbitMQ Connection.

fileno

Returns the Socket File number.

Returns:
is_blocked

Is the connection currently being blocked from publishing by the remote server.

Return type:bool
server_properties

Returns the RabbitMQ Server Properties.

Return type:dict
socket

Returns an instance of the Socket used by the Connection.

Return type:socket
channel(rpc_timeout=60)[source]

Open Channel.

Parameters:

rpc_timeout (int) – Timeout before we give up waiting for an RPC response from the server.

Raises:
  • AMQPInvalidArgument – Invalid Parameters
  • AMQPChannelError – Raises if the channel encountered an error.
  • AMQPConnectionError – Raises if the connection encountered an error.
check_for_errors()[source]

Check Connection for errors.

Raises:AMQPConnectionError – Raises if the connection encountered an error.
Returns:
close()[source]

Close connection.

Raises:AMQPConnectionError – Raises if the connection encountered an error.
Returns:
open()[source]

Open Connection.

Raises:AMQPConnectionError – Raises if the connection encountered an error.