I have a JAX-RS service wrapped in a mule v3.2.1 flow which may trigger exceptions which I would like to capture and process. I would prefer to send the exception to another class and return an OutboundProperty with an http status of 500. Here's what I've got so far:
<flow name="someFlow">
<...do some stuff...>
<custom-exception-strategy class="com.myCustomExceptionHandler>
</default-exception-strategy>
</flow>
myCustomExceptionHandler.handleException() is never called when I trigger an exception. And it is unclear to me how I repackage the mule message to return an http response.
Can anyone please provide some ideas on how to get this to work?
---- update ----
The exception will be a org.mule.api.expression.RequiredValueException, which is thrown when evaluate() is called by an instance of MuleExpressionManager inside a custom message processor:
public class RequestCheckWithAppMessageProcessor
implements FlowConstructAware, MuleContextAware, Disposable, Initialisable, Startable, Stoppable, MessageProcessor
The myCustomExceptionHandler class extends AbstractMessagingExceptionStrategy.