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

StackOverflow https://stackoverflow.com/questions/23292652

  •  09-07-2023
  •  | 
  •  

Domanda

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!

È stato utile?

Soluzione

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

Autorizzato sotto: CC-BY-SA insieme a attribuzione
Non affiliato a StackOverflow
scroll top