I would like to catch errors from SMTP endpoint (for example in case it's misconfigured or the server is down) and when this happens, prevent messages from proceeding the normal path and rather go into an exception flow. An exception handler works and messages are routed into an exception flow. What is unexpected is that the message is duplicated and also proceeds with the "normal" flow as well. I would expect it to go only in one direction: if an email was sent successfully go into a normal endpoint, if sendout failed go into an exception endpoint.
In the provided example below, smtp is failing with UnknownHostException and the message goes into failureEndpoint but the message for some reason also ends up in the outboundEndpoint:
<mule><!-- namespaces omitted for readability -->
<flow name="sample-flowFlow1" doc:name="sample-flowFlow1">
<inbound-endpoint ref="inboundEndpoint" doc:name="AMQP Consumer"/>
<smtp:outbound-endpoint host="foobaz" to="[email protected]" from="[email protected]" subject="test" responseTimeout="10000" doc:name="SMTP"/>
<outbound-endpoint ref="outboundEndpoint" doc:name="AMQP Publisher"/>
<exception-strategy ref="FailureNotification" doc:name="Publish failure notification" />
</flow>
<catch-exception-strategy name="FailureNotification">
<flow-ref name="FailureNotificationFlow" doc:name="Flow Reference" />
</catch-exception-strategy>
<sub-flow name="FailureNotificationFlow" doc:name="FailureNotificationFlow">
<outbound-endpoint ref="failureEndpoint" doc:name="Failure Endpoint"/>
</sub-flow>
</mule>
When a message is published on inboundEndpoint and SMTP connector is misconfigured the way it is done in the provided example, I would like to see the message exclusively in the failureEndpoint, not in both outboundEndpoint and failureEndpoint. How do I accomplish this?
Mule version: 3.4.0