Skip to content
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

Nack messages that cannot be deposited to all queues due to max length reached #995

Closed
uvzubovs opened this issue Oct 12, 2016 · 10 comments
Closed
Assignees
Milestone

Comments

@uvzubovs
Copy link

uvzubovs commented Oct 12, 2016

Under publisher confirms, messages are nacked when the broker could not process them. This issue requests to optionally treat "at least one queue is full" as one of the reasons when the broker could not process a message, instead of discarding old messages, which is the current behavior that may remain the default.

See also: https://groups.google.com/forum/#!topic/rabbitmq-users/Fzsdx1CEiWA

@uvzubovs uvzubovs changed the title Nack messages that cannot be deposit to all queues due to max length reached Nack messages that cannot be deposited to all queues due to max length reached Oct 12, 2016
@michaelklishin
Copy link
Member

Similar in spirit to #499, should be evaluated together with it.

@kjnilsson
Copy link
Contributor

Just to make sure my understanding of the request is correct, the feature requested is to be able to configure a queue with a queue length limit to discard incoming messages (rather than from the head of the queue) and hook into the publisher confirm mechanism to nack when a routable queue is unable to accept a message due to the queue being "full"? Similarly to what may happen if the queue process crashes during processing.

@uvzubovs
Copy link
Author

You got it, Karl! Thank you very much for your insight.

@peaksnail
Copy link

It will make sence! Thumbs up!

@jrlog
Copy link

jrlog commented Oct 18, 2016

Seconded. The message-discarding behavior has been universally unexpected among people I've talked with about it, and it would make sense to add this as an (at least optional) feature.

@hsquirrel
Copy link

Yes, please! I have systems that are far more complicated than they need to be because of the default behavior. This one feature would would be a godsend for me. Keep the default, but make it an option.

@smnirven
Copy link

smnirven commented Aug 2, 2017

I too would love to see this feature

@chadrik
Copy link

chadrik commented Sep 2, 2017

+1

hairyhum pushed a commit that referenced this issue Sep 26, 2017
If a queue is to be overflowed by a delivery it can reject
the delivery or drop messages from the head.
To reject delivery overflow can be configured to `reject_publish`,
to drop head it's `drop_head` (default setting).

Messages which will be rejected should still confirm being routed,
so mandatory expectations are not accumulated on the channel side.

Slave nodes will only confirm if a message was published or discarded.
To drop confirms from slaves, all confirms for a message are cleared
when the message is rejected.

When promoting a new master, left-behind deliveries should
be rejected if the queue is full, just like normal deliveries.

Fixes #995
[#151294447]
hairyhum pushed a commit that referenced this issue Oct 2, 2017
If a queue is to be overflowed by a delivery it can reject
the delivery or drop messages from the head.
To reject delivery overflow can be configured to `reject_publish`,
to drop head it's `drop_head` (default setting).

Messages which will be rejected should still confirm being routed,
so mandatory expectations are not accumulated on the channel side.

Slave nodes will only confirm if a message was published or discarded.
To drop confirms from slaves, all confirms for a message are cleared
when the message is rejected.

When promoting a new master, left-behind deliveries should
be rejected if the queue is full, just like normal deliveries.

Fixes #995
[#151294447]
@michaelklishin michaelklishin added this to the 3.7.0 milestone Oct 30, 2017
@ben-spiller
Copy link

How does this look to a JMS publisher? Would it get an easy-to-handle exception?

@lukebakken
Copy link
Collaborator

@ben-spiller - I chatted with @acogoluegnes to see what would happen in this scenario and the scenario where I commented here. It turns out that the RabbitMQ JMS client does not use publisher confirms so it would not know whether or not a published message was rejected.

As I'm sure you know, JMS specifies an API but not an implementation, and this would be a change to our implementation. If you would like to submit a pull request with this feature here, it would be appreciated. Thanks.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests