-
Notifications
You must be signed in to change notification settings - Fork 36
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
How does amqpstorm handle Rabbitmq memory alarms #118
Comments
The state is exposed on the connection level using the e.g.
I suspect that if you enable confirm_deliveries on the channel level it would raise an exception as well, or at the very least return False, since the message wasn't delivered successfully. |
Mehdi,
The blocked notification support has to be requested when the connection is
created, and it is by default. However, if you provide a "client
properties override" that includes the 'capabilities' definition, you must
define _all_ required capabilities or you risk losing some functionality.
See this for reference:
https://github.com/eandersson/amqpstorm/blob/c32999f5f9abe9c751c25250bd813ab330a46795/amqpstorm/channel0.py#L227
Jay
…On Thu, Apr 21, 2022 at 10:43 PM Erik Olof Gunnar Andersson < ***@***.***> wrote:
The state is exposed on the connection level using the is_blocked
property.
e.g.
while connection.is_blocked:
time.sleep(1)
channel.publish(...)
I suspect that if you enable confirm_deliveries on the channel level it
would raise an exception as well, or at the very least return False, since
the message wasn't delivered successfully.
—
Reply to this email directly, view it on GitHub
<#118 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AABJGJRFC2K5IN73CLPBNNDVGIN5BANCNFSM5T7UNAIA>
.
You are receiving this because you are subscribed to this thread.Message
ID: ***@***.***>
|
Thanks for the swift replies. The |
Mehdi,
As you have noted, there is a significant amount of async communications
involved and the exact handling will depend on how you are configuring
channels and publishing.
Errors/exceptions received async are only generated when a call is made to
[channel].check_for_exceptions(), which most (all?) calls that
transmit/receive on the channel call as part of their handling BEFORE
sending a new message. What needs to be noted here is this exception can be
a channel level issue or it is an issue with a PRIOR message. I believe
you have access to a message id to identify a failed message, but can't be
100% positive. You would need to implement ack/nack tracking per-message
and manage the list of unconfirmed messages, and note that the exception is
BEFORE the current message is sent, so you have a "prior failed" and the
current one failed.
If you don't want to deal with all the tracking, then (1) the channel needs
delivery confirmation and (2) you need to publish with mandatory=True.
This is MUCH slower, but it significantly simplifies the code. On a
publish(mandatory=True) you will (1) receive an exception if there is a
channel issue and the current message is NOT published or on completion you
will receive a boolean response - True = success / False = failure.
Jay
…On Fri, Apr 22, 2022 at 1:32 AM Mehdi GMIRA ***@***.***> wrote:
Thanks for the swift replies. The is_blocked property is asynchronous,
since it relies on a notification sent by Rabbitmq, so we might be trying
to publish on a blocked connection, even if we use is_blocked. So my
question is: what does amqpstorm do when i try to write on a blocked
connection ?
Rabbitmq doc states Writes on a blocked connection will time out or fail
with an I/O write exception..
So how does that transpire ? Will channel.publish(...) raise ?
—
Reply to this email directly, view it on GitHub
<#118 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AABJGJS7HGMW7SY7H7ECT3LVGJBYPANCNFSM5T7UNAIA>
.
You are receiving this because you commented.Message ID:
***@***.***>
|
Hello,
Thanks for your work on this library 👍
I have a question regarding Rabbitmq memory watermarks and the way amqpstorm handles them.
Imagine the following:
Writes on a blocked connection will time out or fail with an I/O write exception.
), also the publisher get notified that a connexion is blocked (Compatible AMQP 0-9-1 clients will be [notified] when they are blocked and unblocked.
).What happens on AMQPstorm side ? Does it raise ? do we lose some messages ? does the block/unblock logic trigger some logic in AMQPStorm ?
Thanks for the help
Links: RMQ doc
The text was updated successfully, but these errors were encountered: