when I set true to channelTransacted ,the application cannot send ack automatically.Though , I have process these messages ,the server still show the messages sended through the channel are unAck .So What is the problem?
when I set true to channelTransacted ,the application cannot send ack automatically.Though , I have process these messages ,the server still show the messages sended through the channel are unAck .So What is the problem?
Are you using the current release? (1.1.2).
Please show your configuration.
Gary P. Russell
Spring Integration Team
SpringSource, a division of VMware
This is my configuration,and I am using 1.1.1 release
and as soon as the application start, my a service will execute ocrWorker.setChannelTransacted(true),the ocrWorker is the container ListenerCode:<bean id="rabbitTransactionManager" class="org.springframework.amqp.rabbit.transaction.RabbitTransactionManager"> <property name="connectionFactory" ref="rabbitConnectionFactory" /> </bean> <rabbit:listener-container id="ocrWorker" concurrency="20" connection-factory="rabbitConnectionFactory" prefetch="20" transaction-size="5" auto-startup="false" message-converter="orcMessageConvert"> <rabbit:listener method="doMessageQueueWork" queue-names="#{sendOcrRequestQueue}" ref="ocrListener" transaction-manager="rabbitTransactionManager" /> </rabbit:listener-container>
Last edited by Gary Russell; Oct 25th, 2012 at 08:29 AM.
Please use [ code ] ... [ /code ] tags when posting code/config (no spaces inside brackets - I have edited your post).
It's too late to set it after the container has started.
The 'channel-transacted' attribute was added to the listener containe in 1.1.2; there were also some other fixes related to transactions.
Please upgrade to 1.1.2 and let us know if you are still having problems.
Gary P. Russell
Spring Integration Team
SpringSource, a division of VMware
I have set the container not automatically start up , you can find that the auto-startup's value in the configuration is false.My service will execute ocrWorker.setChannelTransacted(true) first ,then start up the container. What your meaning is that the problem may be is a bug in 1.1.1 release? I guess that the ack model may be changed and I need to commit and send ack by myself instead of sending automatically,but how could I do to commit or send ack by myself ? thanks
Please use 1.1.2 and let us know if you still have a problem.
Gary P. Russell
Spring Integration Team
SpringSource, a division of VMware
I have used the 1.1.2 released and there is no these problem,but I also have a problem that in the testing of transaction , some of messages can always occur a exception ,but at last these failure messages can not be found in queue, what is the problem ? I surmise that StatefulRetryOperationsInterceptor try some times to execute the message,if it can not execute successfully after many times ,it will send ack to queue?
As stated in the documentation...
http://static.springsource.org/sprin...qp.html#d4e476
...(last paragraph) the default recoverer simply logs a WARN message when the retries are exhausted (default maxAttempts=3); this causes the message to be acked.
You can either write a custom MessageRecoverer and send the bad message someplace else, or you can use the RejectAndDontRequeueRecoverer in conjunction with a Dead Letter Exchange to send the bad message to a Dead Letter Queue.
Gary P. Russell
Spring Integration Team
SpringSource, a division of VMware