Prasad
Prasad

Reputation: 31

How to acknowledge the activemq message in mule using client acknowledge?

Below is my mule configuration, i want to acknowledge using client acknoledge , how can i do it?

<mule>
<jms:activemq-connector name="Active_MQ" brokerURL="tcp://localhost:61616"          validateConnections="true" doc:name="Active MQ" maxRedelivery="2"   persistentDelivery="true"/>
    <flow name="activemqFlow">
    <file:inbound-endpoint path="D:\mule\input" responseTimeout="10000" doc:name="File"/>
    <object-to-string-transformer doc:name="Object to String"/>
    <set-property propertyName="fileName" value="#[message.inboundProperties.originalFilename]" doc:name="Property"/>
    <jms:outbound-endpoint queue="logfilequeue" connector-ref="Active_MQ" doc:name="JMS">
         <jms:transaction action="NONE"/>
    </jms:outbound-endpoint>

</flow>
<flow name="JmsInboundFlow">
    <jms:inbound-endpoint queue="logfilequeue" connector-ref="Active_MQ" doc:name="JMS">
        <jms:client-ack-transaction action="ALWAYS_BEGIN"/>
    </jms:inbound-endpoint>
    <logger message="#[payload.toString()]" level="INFO" doc:name="Logger"/>
    <file:outbound-endpoint path="D:\mule\output" responseTimeout="10000" doc:name="File" outputPattern="#[message.inboundProperties.fileName]"/>
</flow>
</mule>

Upvotes: 0

Views: 957

Answers (2)

Matt Pavlovich
Matt Pavlovich

Reputation: 4316

Note: Be REALLY sure you want to use CLIENT_ACKNOWLEDGE it doesn't work like most people think. It ack's the current message AND all previous within the session. If you have parallel/threaded consumers this setting will inadvertently ack messages that aren't ready to be ack'd yet. ActiveMQ has a INDIVIDUAL_ACKNOWLEDGE which ack's just the single message.

JMS Spec 2.0 has feat requests to make this add'l ack mode a standard.

Upvotes: 1

AnupamBhusari
AnupamBhusari

Reputation: 2415

Try adding acknowledgementMode="CLIENT_ACKNOWLEDGE" in your JMS connector.

You can refer this question for more details

Mule jms with CLIENT_ACKNOWLEDGE mode? Message automatically consumed even though I didn't acknoeledge it

Upvotes: 0

Related Questions