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
- 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.
- desired_capabilities
- AMQPValue
The extension capabilities desired from the peer endpoint. To create a desired_capabilities object, please do as follows:
-
- Create an array of desired capability symbols: capabilities_symbol_array = [types.AMQPSymbol(string)]
-
- Transform the array to AMQPValue object: utils.data_factory(types.AMQPArray(capabilities_symbol_array))
- max_message_size
- int
The maximum allowed message size negotiated for the Link.
- prefetch
- int
The receiver Link credit that determines how many messages the Link will attempt to handle per connection iteration.
- error_policy
- ErrorPolicy
A policy for parsing errors on link, connection and message disposition to determine whether the error should be retryable.
- debug
- bool
Whether to turn on network trace logs. If True, trace logs will be logged at INFO level. Default is False.
- encoding
- str
The encoding to use for parameters supplied as strings. Default is 'UTF-8'
- desired_capabilities
- loop
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
reset_link_credit_async
Asynchronously reset the link credit. This method would send flow control frame to the sender.
async reset_link_credit_async(link_credit, **kwargs)
Parameters
work_async
Update the link status.
async work_async()
Attributes
loop
Feedback
Submit and view feedback for