activemq-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Marcel Casado (JIRA)" <>
Subject [jira] [Commented] (AMQ-3320) ActiveMQ.Advisory.MessageConsumed.TempQueue and AMQ.A.MC.Queue Topics receive advisory messages when TQ or Queue are purged
Date Thu, 12 May 2011 23:26:47 GMT


Marcel Casado commented on AMQ-3320:

  A possible simple solution is to set setAdvisoryForConsumed(false); at the beginning of
the purge() or maybe in  removeMessage(ConnectionContext c, QueueMessageReference r) method

   public void purge() throws Exception {
        ConnectionContext c = createConnectionContext();
        List<MessageReference> list = null;
        do {
            try {
                list = new ArrayList<MessageReference>(pagedInMessages.values());
            }finally {

            for (MessageReference ref : list) {
                try {
                    QueueMessageReference r = (QueueMessageReference) ref;
                    removeMessage(c, r);
                } catch (IOException e) {
            // don't spin/hang if stats are out and there is nothing left in the
            // store
        } while (!list.isEmpty() && this.destinationStatistics.getMessages().getCount()
> 0);
        if (this.destinationStatistics.getMessages().getCount() > 0) {
                    + " after purge complete, message count stats report: "
                    + this.destinationStatistics.getMessages().getCount());

> ActiveMQ.Advisory.MessageConsumed.TempQueue and AMQ.A.MC.Queue Topics receive advisory
messages when TQ or Queue are purged
> ---------------------------------------------------------------------------------------------------------------------------
>                 Key: AMQ-3320
>                 URL:
>             Project: ActiveMQ
>          Issue Type: Bug
>    Affects Versions: 5.4.2, 5.5.0
>            Reporter: Marcel Casado
>            Priority: Minor
>         Attachments:
> I have enabled <policyEntry tempQueue="true" advisoryForConsumed="true" /> in the
broker so I can subscribe to "ActiveMQ.Advisory.MessageConsumed.TempQueue.>" to get notified
of messages consumed on a tempQueue/s. When client shuts down 
> if remaining messages are in the tempQueue an advisory message is generated and send
to the ActiveMQ.Advisory.MessageConsumed.TempQueue topic for each message for that tempQueue.
The same will happen if purge() is called on a TempQueue or Queue for example through JMX.
> In my application I need to know if a message is consumed by a client but I can not differentiate
between a client "ack" massage and one "ack" by the broker when the tempQueue is "disposed"
looking to the message sent to the ActiveMQ.Advisory.MessageConsumed.TempQueue... . 
> Looking at the code for TempQueue and Queue this is the sequence :
> TempQueue.dispose(context) --> purge() --> removeMessage() -> acknowledge()
--> messageConsumed() 
> This is kind of a conceptual issue since myself consider that removing a message due
a purge or a tempQueue cleanup should not trigger a messageConsumed advisory.
> Original ActiveMQ users post :

This message is automatically generated by JIRA.
For more information on JIRA, see:

View raw message