Reputation: 175
I am trying to implement Exception handling in Mule.
I used Rollback Exception Strategy for re trying the message before taking it as a errored out message.
I have the Exception strategy as below.
<rollback-exception-strategy maxRedeliveryAttempts="3" doc:name="Rollback Exception Strategy">
<logger message="message1 #[exception]" level="INFO" doc:name="Logger"/>
<file:outbound-endpoint path="C:\\MuleSamples\backout" responseTimeout="10000" doc:name="File"/>
<on-redelivery-attempts-exceeded doc:name="Redelivery exhausted">
<logger message="#[message.exceptionPayload]" level="INFO" doc:name="Logger"/>
<file:outbound-endpoint path="C:\\MuleSamples\backout" outputPattern="backoutmsg.xml" responseTimeout="10000" doc:name="File"/>
</on-redelivery-attempts-exceeded>
</rollback-exception-strategy>
This is not working, as I expected, even though I configured RedeliveryAttempts as 3, the flow is not redelivering the message. It is just processing it once.
I dont understand what Im missing here.
I have WMQ Inbound Endpoint and used WMQ_transaction.
Any help will be greatly appreciated.
Upvotes: 2
Views: 1804
Reputation: 1187
The Mule document on rollback exception strategy says that:
Mule attempts message redelivery when your flow uses one of the following two types of transports: transactional or reliable
In Mule, VM, JDBC, JMS transports are transactional and JMS, FTP, File, IMAP are reliable transports.
So rollback exception strategy will retry if your flow has an one of the above inbound endpoints.
Upvotes: 1
Reputation: 59
Keep in mind that the rollback-exception-strategy mechanism works only with IllegalStateException. For all the other exceptions you have to define a different strategy.
The Javadocs for Java's IllegalStateException state that it:
Signals that a method has been invoked at an illegal or inappropriate time. In other words, the Java environment or Java application is not in an appropriate state for the requested operation.
Upvotes: 0