uamqp Package

Packages

async_ops
authentication

Modules

address
c_uamqp
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()

Returns

Type Description
str

receive_message

Receive a single message from an AMQP endpoint.

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

Parameters

Name Description
source
Required

The AMQP source endpoint to receive from.

auth

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.

default value: None
timeout

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.

default value: 0
debug

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

default value: False

Returns

Type Description

receive_messages

Receive a batch of messages from an AMQP endpoint.

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

Parameters

Name Description
source
Required

The AMQP source endpoint to receive from.

auth

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.

default value: None
max_batch_size

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.

default value: None
timeout

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.

default value: 0
debug

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

default value: False

Returns

Type Description

send_message

Send a single message to AMQP endpoint.

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

Parameters

Name Description
target
Required

The target AMQP endpoint.

data
Required

The contents of the message to send.

auth

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.

default value: None
debug

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

default value: False

Returns

Type Description

A list of states for each message sent.