简体   繁体   中英

Mule: knowing what component/endpoint threw an exception with default catch exception

I have a default catch exception strategy for my entire flow/subflows. However, I'd like to be able to tell what component/endpoint threw an exception so I can try to restart the flow at that point (I have yet to figure out how to do that as well.)

Is there any easy way to tell what component/endpoint threw the exception, and be able to tell if it was in a foreach, and at what point (by looking at the "counter" variable.)

Thanks!

You can set a variable at the start of flow like this:

<set-variable variableName="flowName" value="Your_flow_name"/>

And the get the flow name like #[flowName] in your exception strategy.

EDIT:

To trigger a flow, create a java component implementing Callable interface, from the context get the MuleClient and use send or dispatch method to send payload to flow. Send causes MuleClient to wait for response while dispatch doesn't.

More info here: http://www.mulesoft.org/documentation/display/current/Using+the+Mule+Client

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM