You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@activemq.apache.org by karen <ja...@gmail.com> on 2011/05/24 14:52:05 UTC
ActiveMQ: Advisory for MessageConsumed
Hello,
I have a requirement to get the messages that have been successfully
consumed.
My application is using the DefaultMessageListenerContainer of spring for
the listeners.
I have enabled the advisoryForConsumed.
My Queue name is 'Test' and it has a listener .
Correspondingly there is an advisory topic called
'ActiveMQ.Advisory.MessageConsumed.Queue.Test' and this has its own
listener. I tried using the advisory for consumed but it doesnt seem to be
working properly.
My use case to illustrate my problem is below:-
1) Send a message to Test Queue.
2) The listener for the Test Queue is invoked. And it throws an
exception(intentionally).
3) Now the topic advisory ActiveMQ.Advisory.MessageConsumed.Queue.Test gets
a new advisory message.
4) The listener for the ActiveMQ.Advisory.MessageConsumed.Queue.Test is
invoked.
Is this supposed to happen even when a message was not consumed. I mean does
this advisory topic get a message for successfull as well as unsuccessfull
consumption?
How do i get to know if a message was successfully consumed.
Thanks for the help
PS: i hope this problem isnt linked to spring transaction management.
--
View this message in context: http://activemq.2283324.n4.nabble.com/ActiveMQ-Advisory-for-MessageConsumed-tp3547010p3547010.html
Sent from the ActiveMQ - User mailing list archive at Nabble.com.
Re: ActiveMQ: Advisory for MessageConsumed
Posted by karen <ja...@gmail.com>.
Hi Gary,
Thanks for replying.
I have logged a Jira for the issue:
https://issues.apache.org/jira/browse/AMQ-3361
thanks
--
View this message in context: http://activemq.2283324.n4.nabble.com/ActiveMQ-Advisory-for-MessageConsumed-tp3547010p3578728.html
Sent from the ActiveMQ - User mailing list archive at Nabble.com.
Re: ActiveMQ: Advisory for MessageConsumed
Posted by Gary Tully <ga...@gmail.com>.
That seems like a bug. Can you open an issue with your test case. The
advisory should be conditional on success of the transaction.
On 31 May 2011 19:22, "karen" <ja...@gmail.com> wrote:
> Hi Brendan,
>
> I have set the listener container to session transacted. When an exception
> is thrown in the listener, then spring rolls back the transaction.
>
> But the problem is that an advisory message is still sent to the consumed
> advisory topic( before the rollback). Thus giving an incorrect indication
of
> sucessfull consumption.
>
> Dont know how to fix this....
>
>
>
> --
> View this message in context:
http://activemq.2283324.n4.nabble.com/ActiveMQ-Advisory-for-MessageConsumed-tp3547010p3563923.html
> Sent from the ActiveMQ - User mailing list archive at Nabble.com.
Re: ActiveMQ: Advisory for MessageConsumed
Posted by karen <ja...@gmail.com>.
Hi Brendan,
I have set the listener container to session transacted. When an exception
is thrown in the listener, then spring rolls back the transaction.
But the problem is that an advisory message is still sent to the consumed
advisory topic( before the rollback). Thus giving an incorrect indication of
sucessfull consumption.
Dont know how to fix this....
--
View this message in context: http://activemq.2283324.n4.nabble.com/ActiveMQ-Advisory-for-MessageConsumed-tp3547010p3563923.html
Sent from the ActiveMQ - User mailing list archive at Nabble.com.
Re: ActiveMQ: Advisory for MessageConsumed
Posted by Brendan Long <br...@realgo.com>.
By default, doesn't ActiveMQ use auto-acknowledge mode? If you change
that to "transacted", throwing an exception should make Spring roll back
the transaction.
On 05/24/2011 07:13 AM, Dejan Bosanac wrote:
> Hi,
>
> the advisory is sent when the message is acknowledged to the broker (as
> consumed). Not sure about your Spring setup but it seems that even if you
> throw an exception it will consider the message as successfully consumed.
>
>
> Regards
Re: ActiveMQ: Advisory for MessageConsumed
Posted by karen <ja...@gmail.com>.
Hi Aneesh
There are many kinds of advisory messages that u can set up. Check this site
out:-
http://activemq.apache.org/advisory-message.html
These are messages that activeMQ sends to specific topics about information
on the producer/consumer etc. All you need to do is update the activemq conf
file and set up a listener for the advisory topic that you are interested
in.
sorry for the late reply
--
View this message in context: http://activemq.2283324.n4.nabble.com/ActiveMQ-Advisory-for-MessageConsumed-tp3547010p3563898.html
Sent from the ActiveMQ - User mailing list archive at Nabble.com.
Re: ActiveMQ: Advisory for MessageConsumed
Posted by Aneesh <cv...@yahoo.co.in>.
HI Karen
Am also having a reqmt to work with the Advisory messages.
Am pretty new to ActiveMQ and doesnt even know how to start with.
Am also using the DefautMessageListenerContainer of Spring.
I have already posted another query in the forum asking help for how to
start with Advisory.
Could you help me put?
Thanks in advance
Aneesh
--
View this message in context: http://activemq.2283324.n4.nabble.com/ActiveMQ-Advisory-for-MessageConsumed-tp3547010p3552278.html
Sent from the ActiveMQ - User mailing list archive at Nabble.com.
Re: ActiveMQ: Advisory for MessageConsumed
Posted by karen <ja...@gmail.com>.
Hi Dejan
Thanks for replying. So it seems advisory for consumed isnt going to serve
the purpose of tracking consumed messages.
Is there any way of approach that might help in tracking successfully
consumed messages...
Thanks alot
--
View this message in context: http://activemq.2283324.n4.nabble.com/ActiveMQ-Advisory-for-MessageConsumed-tp3547010p3547988.html
Sent from the ActiveMQ - User mailing list archive at Nabble.com.
Re: ActiveMQ: Advisory for MessageConsumed
Posted by Dejan Bosanac <de...@nighttale.net>.
Hi,
the advisory is sent when the message is acknowledged to the broker (as
consumed). Not sure about your Spring setup but it seems that even if you
throw an exception it will consider the message as successfully consumed.
Regards
--
Dejan Bosanac - http://twitter.com/dejanb
-----------------
The experts in open source integration and messaging - http://fusesource.com
ActiveMQ in Action - http://www.manning.com/snyder/
Blog - http://www.nighttale.net
Connect at CamelOne <http://camelone.com/> May 24-26
The Open Source Integration Conference
On Tue, May 24, 2011 at 2:52 PM, karen <ja...@gmail.com> wrote:
> Hello,
>
> I have a requirement to get the messages that have been successfully
> consumed.
> My application is using the DefaultMessageListenerContainer of spring for
> the listeners.
>
> I have enabled the advisoryForConsumed.
> My Queue name is 'Test' and it has a listener .
> Correspondingly there is an advisory topic called
> 'ActiveMQ.Advisory.MessageConsumed.Queue.Test' and this has its own
> listener. I tried using the advisory for consumed but it doesnt seem to be
> working properly.
>
> My use case to illustrate my problem is below:-
> 1) Send a message to Test Queue.
> 2) The listener for the Test Queue is invoked. And it throws an
> exception(intentionally).
> 3) Now the topic advisory ActiveMQ.Advisory.MessageConsumed.Queue.Test gets
> a new advisory message.
> 4) The listener for the ActiveMQ.Advisory.MessageConsumed.Queue.Test is
> invoked.
>
> Is this supposed to happen even when a message was not consumed. I mean
> does
> this advisory topic get a message for successfull as well as unsuccessfull
> consumption?
> How do i get to know if a message was successfully consumed.
>
> Thanks for the help
>
> PS: i hope this problem isnt linked to spring transaction management.
>
> --
> View this message in context:
> http://activemq.2283324.n4.nabble.com/ActiveMQ-Advisory-for-MessageConsumed-tp3547010p3547010.html
> Sent from the ActiveMQ - User mailing list archive at Nabble.com.
>