MessageReceiverAsync Class

An asynchronous Message Receiver that opens its own exclsuive Link on an existing Session.

Inheritance
MessageReceiverAsync

Constructor

MessageReceiverAsync(session, source, target, on_message_received, name=None, receive_settle_mode=<ReceiverSettleMode.PeekLock: 1>, send_settle_mode=<SenderSettleMode.Unsettled: 0>, max_message_size=1048576, prefetch=300, properties=None, error_policy=None, debug=False, encoding='UTF-8', desired_capabilities=None, loop=None)

Parameters

session
Session
Required

The underlying Session with which to receive.

source
Source
Required

The AMQP endpoint to receive from.

target
str or bytes
Required

The name of target (i.e. the client).

name
str or bytes
Required

A unique name for the receiver. If not specified a GUID will be used.

receive_settle_mode
ReceiverSettleMode
default value: None

The mode by which to settle message receive operations. If set to PeekLock, the receiver will lock a message once received until the client accepts or rejects the message. If set to ReceiveAndDelete, the service will assume successful receipt of the message and clear it from the queue. The default is PeekLock.

send_settle_mode
SenderSettleMode
default value: ReceiverSettleMode.PeekLock

The mode by which to settle message send operations. If set to Unsettled, the client will wait for a confirmation from the service that the message was successfully sent. If set to 'Settled', the client will not wait for confirmation and assume success.

desired_capabilities
AMQPValue
default value: SenderSettleMode.Unsettled

The extension capabilities desired from the peer endpoint. To create a desired_capabilities object, please do as follows:

    1. Create an array of desired capability symbols: capabilities_symbol_array = [types.AMQPSymbol(string)]
    1. Transform the array to AMQPValue object: utils.data_factory(types.AMQPArray(capabilities_symbol_array))
max_message_size
int
default value: 1048576

The maximum allowed message size negotiated for the Link.

prefetch
int
default value: 300

The receiver Link credit that determines how many messages the Link will attempt to handle per connection iteration.

properties
dict
default value: None

Metadata to be sent in the Link ATTACH frame.

error_policy
ErrorPolicy
default value: None

A policy for parsing errors on link, connection and message disposition to determine whether the error should be retryable.

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.

encoding
str
default value: UTF-8

The encoding to use for parameters supplied as strings. Default is 'UTF-8'

desired_capabilities
default value: None
loop
default value: None

Variables

receive_settle_mode
ReceiverSettleMode

The mode by which to settle message receive operations. If set to PeekLock, the receiver will lock a message once received until the client accepts or rejects the message. If set to ReceiveAndDelete, the service will assume successful receipt of the message and clear it from the queue. The default is PeekLock.

send_settle_mode
SenderSettleMode

The mode by which to settle message send operations. If set to Unsettled, the client will wait for a confirmation from the service that the message was successfully sent. If set to 'Settled', the client will not wait for confirmation and assume success.

max_message_size
int

The maximum allowed message size negotiated for the Link.

Methods

close_async

Close the Receiver asynchronously, leaving the link intact.

destroy_async

Asynchronously close both the Receiver and the Link. Clean up any C objects.

open_async

Asynchronously open the MessageReceiver in order to start processing messages.

reset_link_credit_async

Asynchronously reset the link credit. This method would send flow control frame to the sender.

work_async

Update the link status.

close_async

Close the Receiver asynchronously, leaving the link intact.

async close_async()

destroy_async

Asynchronously close both the Receiver and the Link. Clean up any C objects.

async destroy_async()

open_async

Asynchronously open the MessageReceiver in order to start processing messages.

async open_async()

Exceptions

uamqp.errors.AMQPConnectionError if the Receiver raisesan error on opening. This can happen if the source URI is invalidor the credentials are rejected.

Asynchronously reset the link credit. This method would send flow control frame to the sender.

async reset_link_credit_async(link_credit, **kwargs)

Parameters

link_credit
int
Required

The link credit amount that is requested.

work_async

Update the link status.

async work_async()

Attributes

loop