On Tue, Nov 24, 2009 at 3:16 AM, moreno9000 <moreno.ma...@italtel.it> wrote: > > Yes, > I want to discard sent messages if number of pending messages > exceed a predefined limit. > The reasons for this choice are: > > AMQ side: I'd like to prevent problems due to a queue with > a high number of pending messages. In 5.1 release I saw that > consumers stop receving messages from a queue with too > many messages previously not consumed. This doesn't happen > in 5.3, but in 5.3 I wasn't able to advice a producer that it was > filling the queue so... > > Client side: I'd like to raise an exception to producer in order > to say it "Please, stop sending messages till messages are read > by a consumer".
This sounds similar to the way that producer flow control works: http://activemq.apache.org/producer-flow-control.html The difference is in the predicate you're using. Instead of keying on the amount of memory available, you're keying on the number of messages currently in the destination. You'll need to do much more than just a BrokerFilter to achieve this behavior. Bruce -- perl -e 'print unpack("u30","D0G)u8...@4vyy9&5R\"F)R=6-E+G-N>61E<D\!G;6%I;\"YC;VT*" );' ActiveMQ in Action: http://bit.ly/2je6cQ Blog: http://bruceblog.org/ Twitter: http://twitter.com/brucesnyder