You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@activemq.apache.org by Ivan Pechorin <iv...@gmail.com> on 2010/04/21 07:02:14 UTC

ActiveMQ RA and client acknowledge in a message-driven bean

Hello!

I use JBoss, ActiveMQ resource adapter (RA), and a message-driven bean
(MDB) with a persistent queue.
I need to be able to leave a message in queue if something bad
happened inside method onMessage() of my MDB.
The question is how to achieve it?

I looked into the source of ActiveMQ RA, and it looks like it doesn't
support CLIENT_ACKNOWLEDGE mode. Only DUPS_OK_ACKNOWLEDGE and
AUTO_ACKNOWLEDGE are supported.


P.S. Any help of link to proper piece of documentation is highly
appreciated (I failed to find it).

Best regards, Ivan

Re: ActiveMQ RA and client acknowledge in a message-driven bean

Posted by Gary Tully <ga...@gmail.com>.
that is a reference to a test case source file:
http://svn.apache.org/viewvc/activemq/trunk/activemq-ra/src/test/java/org/apache/activemq/ra/MDBTest.java?view=markup

On 1 June 2010 21:09, Vyom <gr...@gmail.com> wrote:

>
> Hey i didn't get about the exception part,
> "org.apache.activemq.ra.MDBTest.testMessageExceptionReDelivery" What is
> this
> exception,
>
> please explain.
>
>
> Ivan Pechorin wrote:
> >
> > Hello
> >
> > 2010/4/21 Gary Tully <ga...@gmail.com>:
> >> Use a transacted delivery in your endpoint activation and throw an
> >> exception
> >> from onMessage. if you have the source, take a peek at this test:
> >> org.apache.activemq.ra.MDBTest.testMessageExceptionReDelivery
> >
> >
> > Thanks a lot, it works like a charm now!
> >
> > Another thing we had to change is: set jms.useAsyncSend=false in
> > connection URI (connection to embedded broker) instead of
> > jms.useAsyncSend=true.
> >
> >
> > Best regards, Ivan
> >
> >
>
> --
> View this message in context:
> http://old.nabble.com/ActiveMQ-RA-and-client-acknowledge-in-a-message-driven-bean-tp28311771p28746878.html
> Sent from the ActiveMQ - User mailing list archive at Nabble.com.
>
>


-- 
http://blog.garytully.com

Open Source Integration
http://fusesource.com

Re: ActiveMQ RA and client acknowledge in a message-driven bean

Posted by Vyom <gr...@gmail.com>.
Hey i didn't get about the exception part, 
"org.apache.activemq.ra.MDBTest.testMessageExceptionReDelivery" What is this
exception,

please explain.


Ivan Pechorin wrote:
> 
> Hello
> 
> 2010/4/21 Gary Tully <ga...@gmail.com>:
>> Use a transacted delivery in your endpoint activation and throw an
>> exception
>> from onMessage. if you have the source, take a peek at this test:
>> org.apache.activemq.ra.MDBTest.testMessageExceptionReDelivery
> 
> 
> Thanks a lot, it works like a charm now!
> 
> Another thing we had to change is: set jms.useAsyncSend=false in
> connection URI (connection to embedded broker) instead of
> jms.useAsyncSend=true.
> 
> 
> Best regards, Ivan
> 
> 

-- 
View this message in context: http://old.nabble.com/ActiveMQ-RA-and-client-acknowledge-in-a-message-driven-bean-tp28311771p28746878.html
Sent from the ActiveMQ - User mailing list archive at Nabble.com.


Re: ActiveMQ RA and client acknowledge in a message-driven bean

Posted by Ivan Pechorin <iv...@gmail.com>.
Hello

2010/4/21 Gary Tully <ga...@gmail.com>:
> Use a transacted delivery in your endpoint activation and throw an exception
> from onMessage. if you have the source, take a peek at this test:
> org.apache.activemq.ra.MDBTest.testMessageExceptionReDelivery


Thanks a lot, it works like a charm now!

Another thing we had to change is: set jms.useAsyncSend=false in
connection URI (connection to embedded broker) instead of
jms.useAsyncSend=true.


Best regards, Ivan

Re: ActiveMQ RA and client acknowledge in a message-driven bean

Posted by Gary Tully <ga...@gmail.com>.
Use a transacted delivery in your endpoint activation and throw an exception
from onMessage. if you have the source, take a peek at this test:
org.apache.activemq.ra.MDBTest.testMessageExceptionReDelivery


On 21 April 2010 06:02, Ivan Pechorin <iv...@gmail.com> wrote:

> Hello!
>
> I use JBoss, ActiveMQ resource adapter (RA), and a message-driven bean
> (MDB) with a persistent queue.
> I need to be able to leave a message in queue if something bad
> happened inside method onMessage() of my MDB.
> The question is how to achieve it?
>
> I looked into the source of ActiveMQ RA, and it looks like it doesn't
> support CLIENT_ACKNOWLEDGE mode. Only DUPS_OK_ACKNOWLEDGE and
> AUTO_ACKNOWLEDGE are supported.
>
>
> P.S. Any help of link to proper piece of documentation is highly
> appreciated (I failed to find it).
>
> Best regards, Ivan
>



-- 
http://blog.garytully.com

Open Source Integration
http://fusesource.com