Connection

class amqpstorm.UriConnection(uri, ssl_options=None, lazy=False)

Create a new RabbitMQ Connection instance using a Uri.

Usage:

import amqpstorm

connection = amqpstorm.UriConnection(
    'amqp://guest:guest@localhost:5672/%2F?heartbeat=60'
)
class amqpstorm.Connection(hostname, username, password, port=5672, **kwargs)

Create a new RabbitMQ Connection.

Usage:

import amqpstorm

connection = amqpstorm.Connection('localhost', 'guest', 'guest')

Using a SSL Context:

import ssl

import amqpstorm

ssl_options = {
    'context': ssl.create_default_context(cafile='cacert.pem'),
    'server_hostname': 'rmq.eandersson.net'
}

connection = amqpstorm.Connection(
    'rmq.eandersson.net', 'guest', 'guest', port=5671,
     ssl=True, ssl_options=ssl_options
)
channel(rpc_timeout=60, lazy=False)

Open a Channel.

Parameters:

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

Raises:
channels

Returns a dictionary of the Channels currently available.

Return type:dict
check_for_errors()

Check Connection for errors.

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

Close Connection.

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

Returns the Socket File number.

Returns:
is_blocked

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

Return type:bool
max_allowed_channels

Returns the maximum allowed channels for the connection.

Return type:int
max_frame_size

Returns the maximum allowed frame size for the connection.

Return type:int
open()

Open Connection.

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

Returns the RabbitMQ Server Properties.

Return type:dict
socket

Returns an instance of the Socket used by the Connection.

Return type:socket