How to rollback message taken from IBM MQ in spring integration -


I have a spring integration flow like this:

  1) Channel-adapter- & gt; 1.1) Connected to output-channel - & gt; Service-catalyst - & gt; Outbound-channel-adapter (to send feedback) 1.2) connected to error-channel - & gt; Exception-type-router 1.2.1) Based on the exception type using the outbound-channel-adapter, the message is sent to different queues  

I have accepted that " after messaging Chalit- channel adapter. error-channel, I want to start rollback exception of a specific type

first, I add service-catalyst exception-type router output Tried. But I missed the exception Confirms:

  code: & lt; service-catalyst id = "rollback Aktivetr" input-channel = "rollback channel" reference = "Error Transformers" method = "rollback message" / & gt ; public void rollback message (messaging exception message) {TransactionAspectSupport.currentTransactionStatus (). SetRollbackOnly (); System.out.println ( "message rolled:" + transactions Denpradrshit support. transaction status (). IsRollbackOnly ()) ;} Exception: org.springframework.messaging.MessageHandlingException: org.springframework.transaction.NoTransactionException: No Transaction Scope Managed aspect TransactionStatus  

Then, I tried with the outbound channel adapter expression, but an exception was reunited

  code: & Lt; Outbound channel-adapter id = "RollbackOut" channel = "RollBackChannel" expression = "T (org.springframework.transaction.interceptor.TransactionAspectSupport). CurrentTransactionStatus () setRollbackOnly ()" / & gt. Exception: OrgkspringframeworkkmessagingkMessageHandlingException: expression evaluation failed: T (org.springframework.transaction.interceptor.TransactionAspectSupport). Current Transaction Status () SetRollbackOnly ()  

Please advise to apply rollback in this scenario.

After the

Container uses local transactions on the session by default. No AOP is included, throw an exception in straight words and container back messages will be issued.


Comments