You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@activemq.apache.org by jstordeur <je...@gmail.com> on 2013/11/07 14:12:59 UTC

Advisory for consumed message for topics

Hello,

I'm running ActiveMQ 5.8. I'm trying to use advisory topics to monitore the
processing of the messages by the clients, I have enabled the following
advisory in the configuration file:

        /<destinationPolicy>
            <policyMap>
              <policyEntries>
                <policyEntry topic=">" advisoryForConsumed="true" 
advisoryForDelivery="true" >
                  <pendingMessageLimitStrategy>
                    <constantPendingMessageLimitStrategy limit="1"/>
                  </pendingMessageLimitStrategy>
                </policyEntry>
                <policyEntry queue=">" advisoryForConsumed="true"
advisoryForDelivery="true" />
               </policyEntries>
            </policyMap>
        </destinationPolicy>/

Now I have a client that uses CLIENT_ACKNOWLEDGE policy and that
intentionaly does not acknowledge the messages it receives.

When I use the client to consume from a queue and then send a message to
this queue, I can see one message arriving in the corresponding
/ActiveMQ.Advisory.MessageDelivered.Queue/
and if I acknowledge the message I see another arriving in
/ActiveMQ.Advisory.MessageConsumed.Queue/

So this is working exactly as I would expect it.
However when I eprform the same test with a topic, I see messages arriving
in the delivered advisory but I never have one in the Consumed one, even
when I acknowledge the message and even when using
Session::AUTO_ACKNOWLEDGE.

Is there something missing in the configuration?

Thank you for your time.



--
View this message in context: http://activemq.2283324.n4.nabble.com/Advisory-for-consumed-message-for-topics-tp4674005.html
Sent from the ActiveMQ - User mailing list archive at Nabble.com.

Re: Advisory for consumed message for topics

Posted by jstordeur <je...@gmail.com>.
Hello,

I have created this item:
https://issues.apache.org/jira/browse/AMQ-4873





--
View this message in context: http://activemq.2283324.n4.nabble.com/Advisory-for-consumed-message-for-topics-tp4674005p4674196.html
Sent from the ActiveMQ - User mailing list archive at Nabble.com.

Re: Advisory for consumed message for topics

Posted by Christian Posta <ch...@gmail.com>.
jstordeur: can you open a JIRA and reference this mailing list thread?

On Fri, Nov 8, 2013 at 11:08 AM, jstordeur <je...@gmail.com> wrote:
> I tried with a durable subscription and I see a message arriving in the
> message consumed advisory topic after the acknowledgment of the client.
> And yes by default those advisories are not activated.
>
>
>
> --
> View this message in context: http://activemq.2283324.n4.nabble.com/Advisory-for-consumed-message-for-topics-tp4674005p4674105.html
> Sent from the ActiveMQ - User mailing list archive at Nabble.com.



-- 
Christian Posta
http://www.christianposta.com/blog
twitter: @christianposta

Re: Advisory for consumed message for topics

Posted by jstordeur <je...@gmail.com>.
I tried with a durable subscription and I see a message arriving in the
message consumed advisory topic after the acknowledgment of the client.
And yes by default those advisories are not activated.



--
View this message in context: http://activemq.2283324.n4.nabble.com/Advisory-for-consumed-message-for-topics-tp4674005p4674105.html
Sent from the ActiveMQ - User mailing list archive at Nabble.com.

Re: Advisory for consumed message for topics

Posted by Christian Posta <ch...@gmail.com>.
Yah, but I believe that's how durable subs do it... but i didn't try
it :) so don't shoot me :) I just browsed the code for a sec. A flood
of advisory messages for this would be a problem, but by default i
think these advisories are turned off?

On Thu, Nov 7, 2013 at 2:14 PM, Timothy Bish <ta...@gmail.com> wrote:
> On 11/07/2013 03:58 PM, Christian Posta wrote:
>>
>> Actually... after quick browsing the code (and i didn't try it yet...)
>> it looks like for non-durable subscriptions to a topic, the "message
>> consumed" advisory will not be fired because topic.acknowledge(...)
>> will not be called from TopicSubscription#acknowledge(...). Don't
>> think this is on purpose, therefore a missing feature/bug.
>>
>> I can open a jira for this and get a patch+tests going if someone can
>> confirm this is not on purpose.. that is... non-durable topic messages
>> that get ack'd should also be fired to the message-consumed
>> advisories...
>
>
> Wouldn't that result in a rush of advisories for each consumer that's
> subscribed to that Topic and acks that message?
>
>
>>
>> On Thu, Nov 7, 2013 at 1:16 PM, Christian Posta
>> <ch...@gmail.com> wrote:
>>>
>>> Should work the same for both queue and topic.
>>> Can you verify you're listening to
>>> ActiveMQ.MessageConsumed.Topic.<topicname>?
>>>
>>> On Thu, Nov 7, 2013 at 6:12 AM, jstordeur <je...@gmail.com>
>>> wrote:
>>>>
>>>> Hello,
>>>>
>>>> I'm running ActiveMQ 5.8. I'm trying to use advisory topics to monitore
>>>> the
>>>> processing of the messages by the clients, I have enabled the following
>>>> advisory in the configuration file:
>>>>
>>>>          /<destinationPolicy>
>>>>              <policyMap>
>>>>                <policyEntries>
>>>>                  <policyEntry topic=">" advisoryForConsumed="true"
>>>> advisoryForDelivery="true" >
>>>>                    <pendingMessageLimitStrategy>
>>>>                      <constantPendingMessageLimitStrategy limit="1"/>
>>>>                    </pendingMessageLimitStrategy>
>>>>                  </policyEntry>
>>>>                  <policyEntry queue=">" advisoryForConsumed="true"
>>>> advisoryForDelivery="true" />
>>>>                 </policyEntries>
>>>>              </policyMap>
>>>>          </destinationPolicy>/
>>>>
>>>> Now I have a client that uses CLIENT_ACKNOWLEDGE policy and that
>>>> intentionaly does not acknowledge the messages it receives.
>>>>
>>>> When I use the client to consume from a queue and then send a message to
>>>> this queue, I can see one message arriving in the corresponding
>>>> /ActiveMQ.Advisory.MessageDelivered.Queue/
>>>> and if I acknowledge the message I see another arriving in
>>>> /ActiveMQ.Advisory.MessageConsumed.Queue/
>>>>
>>>> So this is working exactly as I would expect it.
>>>> However when I eprform the same test with a topic, I see messages
>>>> arriving
>>>> in the delivered advisory but I never have one in the Consumed one, even
>>>> when I acknowledge the message and even when using
>>>> Session::AUTO_ACKNOWLEDGE.
>>>>
>>>> Is there something missing in the configuration?
>>>>
>>>> Thank you for your time.
>>>>
>>>>
>>>>
>>>> --
>>>> View this message in context:
>>>> http://activemq.2283324.n4.nabble.com/Advisory-for-consumed-message-for-topics-tp4674005.html
>>>> Sent from the ActiveMQ - User mailing list archive at Nabble.com.
>>>
>>>
>>>
>>> --
>>> Christian Posta
>>> http://www.christianposta.com/blog
>>> twitter: @christianposta
>>
>>
>>
>
>
> --
> Tim Bish
> Sr Software Engineer | RedHat Inc.
> tim.bish@redhat.com | www.fusesource.com | www.redhat.com
> skype: tabish121 | twitter: @tabish121
> blog: http://timbish.blogspot.com/
>



-- 
Christian Posta
http://www.christianposta.com/blog
twitter: @christianposta

Re: Advisory for consumed message for topics

Posted by Timothy Bish <ta...@gmail.com>.
On 11/07/2013 03:58 PM, Christian Posta wrote:
> Actually... after quick browsing the code (and i didn't try it yet...)
> it looks like for non-durable subscriptions to a topic, the "message
> consumed" advisory will not be fired because topic.acknowledge(...)
> will not be called from TopicSubscription#acknowledge(...). Don't
> think this is on purpose, therefore a missing feature/bug.
>
> I can open a jira for this and get a patch+tests going if someone can
> confirm this is not on purpose.. that is... non-durable topic messages
> that get ack'd should also be fired to the message-consumed
> advisories...

Wouldn't that result in a rush of advisories for each consumer that's 
subscribed to that Topic and acks that message?

>
> On Thu, Nov 7, 2013 at 1:16 PM, Christian Posta
> <ch...@gmail.com> wrote:
>> Should work the same for both queue and topic.
>> Can you verify you're listening to ActiveMQ.MessageConsumed.Topic.<topicname>?
>>
>> On Thu, Nov 7, 2013 at 6:12 AM, jstordeur <je...@gmail.com> wrote:
>>> Hello,
>>>
>>> I'm running ActiveMQ 5.8. I'm trying to use advisory topics to monitore the
>>> processing of the messages by the clients, I have enabled the following
>>> advisory in the configuration file:
>>>
>>>          /<destinationPolicy>
>>>              <policyMap>
>>>                <policyEntries>
>>>                  <policyEntry topic=">" advisoryForConsumed="true"
>>> advisoryForDelivery="true" >
>>>                    <pendingMessageLimitStrategy>
>>>                      <constantPendingMessageLimitStrategy limit="1"/>
>>>                    </pendingMessageLimitStrategy>
>>>                  </policyEntry>
>>>                  <policyEntry queue=">" advisoryForConsumed="true"
>>> advisoryForDelivery="true" />
>>>                 </policyEntries>
>>>              </policyMap>
>>>          </destinationPolicy>/
>>>
>>> Now I have a client that uses CLIENT_ACKNOWLEDGE policy and that
>>> intentionaly does not acknowledge the messages it receives.
>>>
>>> When I use the client to consume from a queue and then send a message to
>>> this queue, I can see one message arriving in the corresponding
>>> /ActiveMQ.Advisory.MessageDelivered.Queue/
>>> and if I acknowledge the message I see another arriving in
>>> /ActiveMQ.Advisory.MessageConsumed.Queue/
>>>
>>> So this is working exactly as I would expect it.
>>> However when I eprform the same test with a topic, I see messages arriving
>>> in the delivered advisory but I never have one in the Consumed one, even
>>> when I acknowledge the message and even when using
>>> Session::AUTO_ACKNOWLEDGE.
>>>
>>> Is there something missing in the configuration?
>>>
>>> Thank you for your time.
>>>
>>>
>>>
>>> --
>>> View this message in context: http://activemq.2283324.n4.nabble.com/Advisory-for-consumed-message-for-topics-tp4674005.html
>>> Sent from the ActiveMQ - User mailing list archive at Nabble.com.
>>
>>
>> --
>> Christian Posta
>> http://www.christianposta.com/blog
>> twitter: @christianposta
>
>


-- 
Tim Bish
Sr Software Engineer | RedHat Inc.
tim.bish@redhat.com | www.fusesource.com | www.redhat.com
skype: tabish121 | twitter: @tabish121
blog: http://timbish.blogspot.com/


Re: Advisory for consumed message for topics

Posted by Christian Posta <ch...@gmail.com>.
Actually... after quick browsing the code (and i didn't try it yet...)
it looks like for non-durable subscriptions to a topic, the "message
consumed" advisory will not be fired because topic.acknowledge(...)
will not be called from TopicSubscription#acknowledge(...). Don't
think this is on purpose, therefore a missing feature/bug.

I can open a jira for this and get a patch+tests going if someone can
confirm this is not on purpose.. that is... non-durable topic messages
that get ack'd should also be fired to the message-consumed
advisories...

On Thu, Nov 7, 2013 at 1:16 PM, Christian Posta
<ch...@gmail.com> wrote:
> Should work the same for both queue and topic.
> Can you verify you're listening to ActiveMQ.MessageConsumed.Topic.<topicname>?
>
> On Thu, Nov 7, 2013 at 6:12 AM, jstordeur <je...@gmail.com> wrote:
>> Hello,
>>
>> I'm running ActiveMQ 5.8. I'm trying to use advisory topics to monitore the
>> processing of the messages by the clients, I have enabled the following
>> advisory in the configuration file:
>>
>>         /<destinationPolicy>
>>             <policyMap>
>>               <policyEntries>
>>                 <policyEntry topic=">" advisoryForConsumed="true"
>> advisoryForDelivery="true" >
>>                   <pendingMessageLimitStrategy>
>>                     <constantPendingMessageLimitStrategy limit="1"/>
>>                   </pendingMessageLimitStrategy>
>>                 </policyEntry>
>>                 <policyEntry queue=">" advisoryForConsumed="true"
>> advisoryForDelivery="true" />
>>                </policyEntries>
>>             </policyMap>
>>         </destinationPolicy>/
>>
>> Now I have a client that uses CLIENT_ACKNOWLEDGE policy and that
>> intentionaly does not acknowledge the messages it receives.
>>
>> When I use the client to consume from a queue and then send a message to
>> this queue, I can see one message arriving in the corresponding
>> /ActiveMQ.Advisory.MessageDelivered.Queue/
>> and if I acknowledge the message I see another arriving in
>> /ActiveMQ.Advisory.MessageConsumed.Queue/
>>
>> So this is working exactly as I would expect it.
>> However when I eprform the same test with a topic, I see messages arriving
>> in the delivered advisory but I never have one in the Consumed one, even
>> when I acknowledge the message and even when using
>> Session::AUTO_ACKNOWLEDGE.
>>
>> Is there something missing in the configuration?
>>
>> Thank you for your time.
>>
>>
>>
>> --
>> View this message in context: http://activemq.2283324.n4.nabble.com/Advisory-for-consumed-message-for-topics-tp4674005.html
>> Sent from the ActiveMQ - User mailing list archive at Nabble.com.
>
>
>
> --
> Christian Posta
> http://www.christianposta.com/blog
> twitter: @christianposta



-- 
Christian Posta
http://www.christianposta.com/blog
twitter: @christianposta

Re: Advisory for consumed message for topics

Posted by Christian Posta <ch...@gmail.com>.
Should work the same for both queue and topic.
Can you verify you're listening to ActiveMQ.MessageConsumed.Topic.<topicname>?

On Thu, Nov 7, 2013 at 6:12 AM, jstordeur <je...@gmail.com> wrote:
> Hello,
>
> I'm running ActiveMQ 5.8. I'm trying to use advisory topics to monitore the
> processing of the messages by the clients, I have enabled the following
> advisory in the configuration file:
>
>         /<destinationPolicy>
>             <policyMap>
>               <policyEntries>
>                 <policyEntry topic=">" advisoryForConsumed="true"
> advisoryForDelivery="true" >
>                   <pendingMessageLimitStrategy>
>                     <constantPendingMessageLimitStrategy limit="1"/>
>                   </pendingMessageLimitStrategy>
>                 </policyEntry>
>                 <policyEntry queue=">" advisoryForConsumed="true"
> advisoryForDelivery="true" />
>                </policyEntries>
>             </policyMap>
>         </destinationPolicy>/
>
> Now I have a client that uses CLIENT_ACKNOWLEDGE policy and that
> intentionaly does not acknowledge the messages it receives.
>
> When I use the client to consume from a queue and then send a message to
> this queue, I can see one message arriving in the corresponding
> /ActiveMQ.Advisory.MessageDelivered.Queue/
> and if I acknowledge the message I see another arriving in
> /ActiveMQ.Advisory.MessageConsumed.Queue/
>
> So this is working exactly as I would expect it.
> However when I eprform the same test with a topic, I see messages arriving
> in the delivered advisory but I never have one in the Consumed one, even
> when I acknowledge the message and even when using
> Session::AUTO_ACKNOWLEDGE.
>
> Is there something missing in the configuration?
>
> Thank you for your time.
>
>
>
> --
> View this message in context: http://activemq.2283324.n4.nabble.com/Advisory-for-consumed-message-for-topics-tp4674005.html
> Sent from the ActiveMQ - User mailing list archive at Nabble.com.



-- 
Christian Posta
http://www.christianposta.com/blog
twitter: @christianposta