Skip to content

Instantly share code, notes, and snippets.

@cgorshing
Created February 24, 2014 22:01
Show Gist options
  • Save cgorshing/9198086 to your computer and use it in GitHub Desktop.
Save cgorshing/9198086 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