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/19 14:25:34 UTC

ActiveMQ RA: how to make MDB with CLIENT_ACKNOWLEDGE?

Hello

We have a message-driven bean in JBoss with ActiveMQ resource adapter (RA).
It seems like ActiveMQ RA doesn't support CLIENT_ACKNOWLEDGE mode. It
supports only DUPS_OK_ACKNOWLEDGE and AUTO_ACKNOWLEDGE modes.

Basically, I need to be able to leave a message in queue if something bad
happened inside method onMessage() of my MDB. How can I achieve this?

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

Best regards, Ivan
-- 
View this message in context: http://old.nabble.com/ActiveMQ-RA%3A-how-to-make-MDB-with-CLIENT_ACKNOWLEDGE--tp28287660p28287660.html
Sent from the ActiveMQ - User mailing list archive at Nabble.com.


RE: ActiveMQ RA: how to make MDB with CLIENT_ACKNOWLEDGE?

Posted by Sachindra Nath <Sa...@efi.com>.
Hi Ivan,
  You can't do that. It'd be against the EJB specifications. See below:

5.4.14 Message Acknowledgment for JMS Message-Driven Beans
JMS message-driven beans should not attempt to use the JMS API for message acknowledgment. Message
acknowledgment is automatically handled by the container. If the message-driven bean uses container-
managed transaction demarcation, message acknowledgment is handled automatically as a part of
the transaction commit. If bean-managed transaction demarcation is used, the message receipt cannot be
part of the bean-managed transaction, and, in this case, the receipt is acknowledged by the container. If
bean-managed transaction demarcation is used, the Bean Provider can indicate whether JMS
AUTO_ACKNOWLEDGE semantics or DUPS_OK_ACKNOWLEDGE semantics should apply by using the
activationConfig element of the MessageDriven annotation or by using the activation-
config-property deployment descriptor element. The property name used to specify the
acknowledgment mode is acknowledgeMode. If the acknowledgeMode property is not specified,
JMS AUTO_ACKNOWLEDGE semantics are assumed. The value of the acknowledgeMode property
must be either Auto-acknowledge or Dups-ok-acknowledge for a JMS message-driven bean.

Regards
Sachindra

-----Original Message-----
From: Ivan Pechorin [mailto:ivan.pechorin@gmail.com]
Sent: Monday, April 19, 2010 5:56 PM
To: users@activemq.apache.org
Subject: ActiveMQ RA: how to make MDB with CLIENT_ACKNOWLEDGE?


Hello

We have a message-driven bean in JBoss with ActiveMQ resource adapter (RA).
It seems like ActiveMQ RA doesn't support CLIENT_ACKNOWLEDGE mode. It
supports only DUPS_OK_ACKNOWLEDGE and AUTO_ACKNOWLEDGE modes.

Basically, I need to be able to leave a message in queue if something bad
happened inside method onMessage() of my MDB. How can I achieve this?

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

Best regards, Ivan
--
View this message in context: http://old.nabble.com/ActiveMQ-RA%3A-how-to-make-MDB-with-CLIENT_ACKNOWLEDGE--tp28287660p28287660.html
Sent from the ActiveMQ - User mailing list archive at Nabble.com.


Confidentiality notice:  This message may contain confidential information.  It is intended only for the person to whom it is addressed. If you are not that person, you should not use this message.  We request that you notify us by replying to this message, and then delete all copies including any contained in your reply.  Thank you.

Re: ActiveMQ RA: how to make MDB with CLIENT_ACKNOWLEDGE?

Posted by "Stefan Kleineikenscheidt (K15t Software)" <st...@k15t.com>.
Hi Ivan,

the acknowledge is up to the container in case of MDBs.  Your onMessage()
method "acknowledges" the message by returning without throwing an
exception. Also the other way round: just throw an exception, and the
container will not acknowledge the message (an try to redeliver it).

-Stefan



On Mon, Apr 19, 2010 at 2:25 PM, Ivan Pechorin <iv...@gmail.com>wrote:

>
> Hello
>
> We have a message-driven bean in JBoss with ActiveMQ resource adapter (RA).
> It seems like ActiveMQ RA doesn't support CLIENT_ACKNOWLEDGE mode. It
> supports only DUPS_OK_ACKNOWLEDGE and AUTO_ACKNOWLEDGE modes.
>
> Basically, I need to be able to leave a message in queue if something bad
> happened inside method onMessage() of my MDB. How can I achieve this?
>
> P.S. Any help of link to proper piece of documentation is highly
> appreciated
> (I failed to find it).
>
> Best regards, Ivan
> --
> View this message in context:
> http://old.nabble.com/ActiveMQ-RA%3A-how-to-make-MDB-with-CLIENT_ACKNOWLEDGE--tp28287660p28287660.html
> Sent from the ActiveMQ - User mailing list archive at Nabble.com.
>
>