Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save schatterjee4/4aca935f1e12a5d79864d3a2814ecc4b to your computer and use it in GitHub Desktop.
Save schatterjee4/4aca935f1e12a5d79864d3a2814ecc4b to your computer and use it in GitHub Desktop.
Small Mule example showing a choice-exception-strategy (copied from the Mule docs)
<flow name="RouteByExceptionType">
<jms:inbound-endpoint queue="in">
<jms:transaction action="ALWAYS_BEGIN" />
</jms:inbound-endpoint>
<test:component/>
<jms:outbound-endpoint queue="out">
<jms:transaction action="ALWAYS_JOIN" />
</jms:outbound-endpoint>
<choice-exception-strategy>
<catch-exception-strategy when="exception.causedBy(com.company.BusinessException)">
<jms:outbound-endpoint queue="dead.letter">
<jms:transaction action="ALWAYS_JOIN" />
</jms:outbound-endpoint>
</catch-exception-strategy>
<rollback-exception-strategy when="exception.causedBy(com.company.NonBusinessException)">
<logger level="ERROR" message="Payload failing: #[payload]"/>
</rollback-exception-strategy>
</choice-exception-strategy>
</flow>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment