uamqp package

Packages

async_ops
authentication

Modules

address
client
compat
connection
constants
errors
message
mgmt_operation
receiver
sender
session
types
utils

Functions

get_platform_info()

Gets the current platform information.

get_platform_info()

Return type

str

receive_message(source, auth=None, timeout=0, debug=False)

Receive a single message from an AMQP endpoint.

receive_message(source, auth=None, timeout=0, debug=False)

Parameters

source
str, bytes or Source

The AMQP source endpoint to receive from.

auth
AMQPAuth
default value: None

The authentication credentials for the endpoint. This should be one of the subclasses of uamqp.authentication.AMQPAuth. Currently this includes:

  • uamqp.authentication.SASLAnonymous

  • uamqp.authentication.SASLPlain

  • uamqp.authentication.SASTokenAuth

If no authentication is supplied, SASLAnnoymous will be used by default.

timeout
default value: 0

The timeout in milliseconds after which to return None if no messages are retrieved. If set to 0 (the default), the receiver will not timeout and will continue to wait for messages until interrupted.

debug
bool
default value: False

Whether to turn on network trace logs. If True, trace logs will be logged at INFO level. Default is False.

Return type

receive_messages(source, auth=None, max_batch_size=None, timeout=0, debug=False, **kwargs)

Receive a batch of messages from an AMQP endpoint.

receive_messages(source, auth=None, max_batch_size=None, timeout=0, debug=False, **kwargs)

Parameters

source
str, bytes or Source

The AMQP source endpoint to receive from.

auth
AMQPAuth
default value: None

The authentication credentials for the endpoint. This should be one of the subclasses of ~uamqp.authentication.AMQPAuth. Currently this includes:

  • uamqp.authentication.SASLAnonymous

  • uamqp.authentication.SASLPlain

  • uamqp.authentication.SASTokenAuth

If no authentication is supplied, SASLAnnoymous will be used by default.

max_batch_size
default value: None

The maximum number of messages to return in a batch. If the receiver receives a smaller number than this, it will not wait to return them so the actual number returned can be anything up to this value. If the receiver reaches a timeout, an empty list will be returned.

timeout
default value: 0

The timeout in milliseconds after which to return if no messages are retrieved. If set to 0 (the default), the receiver will not timeout and will continue to wait for messages until interrupted.

debug
bool
default value: False

Whether to turn on network trace logs. If True, trace logs will be logged at INFO level. Default is False.

Return type

send_message(target, data, auth=None, debug=False)

Send a single message to AMQP endpoint.

send_message(target, data, auth=None, debug=False)

Parameters

target
str, bytes or Target

The target AMQP endpoint.

data
str, bytes or Message

The contents of the message to send.

auth
AMQPAuth
default value: None

The authentication credentials for the endpoint. This should be one of the subclasses of uamqp.authentication.AMQPAuth. Currently this includes:

  • uamqp.authentication.SASLAnonymous

  • uamqp.authentication.SASLPlain

  • uamqp.authentication.SASTokenAuth

If no authentication is supplied, SASLAnnoymous will be used by default.

debug
bool
default value: False

Whether to turn on network trace logs. If True, trace logs will be logged at INFO level. Default is False.

Returns

A list of states for each message sent.

Return type