You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@activemq.apache.org by fengcanyue <15...@qq.com> on 2015/10/09 04:31:38 UTC
ActiveMQ.Advisory.MessageDiscarded.Queue
advisory code:
Destination destination =session.createQueue("test");
Destination advisoryDestination =
AdvisorySupport.getMessageDiscardedAdvisoryTopic(destination);
MessageConsumer consumer = session.createConsumer(advisoryDestination);
consumer.setMessageListener(new MessageListener(){
@Override
public void onMessage(Message arg0) {
}});
in the broker config code :
policyEntry.setAdvisoryForDiscardingMessages(true);
I hope to get notification when message is discarded.but i cannot get any
message.
I want to know consumer will get a discardmessage under what circumstances.
thanks!
--
View this message in context: http://activemq.2283324.n4.nabble.com/ActiveMQ-Advisory-MessageDiscarded-Queue-tp4702789.html
Sent from the ActiveMQ - User mailing list archive at Nabble.com.
Re: ActiveMQ.Advisory.MessageDiscarded.Queue
Posted by Tim Bain <tb...@alumni.duke.edu>.
I believe that the discarded message count in JMX is incremented (and so
I'd expect an advisory message to be generated, though I've never looked
for one to confirm that) when a message expires while still on the broker.
(I believe I've observed that if the message expires after being dispatched
to the consumer but before being consumed, the count doesn't increment and
I'd expect no advisory message is generated.) There may be other
circumstances as well.
Tim
On Oct 9, 2015 8:15 AM, "fengcanyue" <15...@qq.com> wrote:
> advisory code:
> Destination destination =session.createQueue("test");
> Destination advisoryDestination =
> AdvisorySupport.getMessageDiscardedAdvisoryTopic(destination);
> MessageConsumer consumer = session.createConsumer(advisoryDestination);
> consumer.setMessageListener(new MessageListener(){
>
> @Override
> public void onMessage(Message arg0) {
> }});
> in the broker config code :
> policyEntry.setAdvisoryForDiscardingMessages(true);
>
>
> I hope to get notification when message is discarded.but i cannot get any
> message.
> I want to know consumer will get a discardmessage under what
> circumstances.
>
> thanks!
>
>
>
>
> --
> View this message in context:
> http://activemq.2283324.n4.nabble.com/ActiveMQ-Advisory-MessageDiscarded-Queue-tp4702789.html
> Sent from the ActiveMQ - User mailing list archive at Nabble.com.
>