You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@camel.apache.org by Claus Ibsen <cl...@gmail.com> on 2017/09/03 14:52:14 UTC

Re: Help needed: how to use Camel JMS Client Acknowledge mode for queue consumption

Hi

You can use transacted=true to use transtanced ack mode which will do
this automatic, to only ACK if success.

The client mode ought only to ack if you call session.acknowledge()
manually via the JMS api, but that is harder to do via Camel as you
dont have easy access to this API and its not really a recommended
mode to be using.

On Thu, Aug 24, 2017 at 7:24 PM, lye <li...@gmail.com> wrote:
> Hi, Claus, Willem and Camel Friends. I need some help with jms
> acknowledgementModeName client acknowledge. I tried the following code, but
> it always auto acknowledged whenever a message is dropped to the queue (IBM
> websphere MQ)
>
> Use case: read a message from the MQ without removing it from the queue.
> Then process the message. If no exception is thrown during the entire
> processing route, then acknowledge it. Otherwise, keep it in the queue.
>
> Code:
> <route id="Case-Request-Queue-Consumer-Route">
>                         <from
>
> uri="wmq:queue:{{mq}}?maxConcurrentConsumers={{maxConsumer}}&amp;acknowledgementModeName=CLIENT_ACKNOWLEDGE"
> />
>
>                         <bean ref="unMarshallMessage" />
>
>                         <to uri="direct:processMessage" />
>
>                 </route>
>
> When the message reaches unMarshallMessage processor bean, it's removed from
> the queue.
>
> Please let me know what I need to change. I tried searching for client
> acknowledge mode sample code, but couldn't find much info. Any thoughts or
> sample code will be greatly appreciated!
>
>
>
> --
> View this message in context: http://camel.465427.n5.nabble.com/Help-needed-how-to-use-Camel-JMS-Client-Acknowledge-mode-for-queue-consumption-tp5812049.html
> Sent from the Camel - Users mailing list archive at Nabble.com.



-- 
Claus Ibsen
-----------------
http://davsclaus.com @davsclaus
Camel in Action 2: https://www.manning.com/ibsen2