use of org.mule.runtime.core.privileged.routing.CouldNotRouteOutboundMessageException in project mule by mulesoft.
the class RoundRobin method route.
/**
* Process the event using the next target route in sequence
*/
@Override
public CoreEvent route(CoreEvent event) throws MuleException {
int modulo = getAndIncrementModuloN(routes.size());
if (modulo < 0) {
throw new CouldNotRouteOutboundMessageException(this);
}
Processor mp = routes.get(modulo);
try {
return doProcessRoute(mp, event);
} catch (MuleException ex) {
throw new RoutingException(this, ex);
}
}
use of org.mule.runtime.core.privileged.routing.CouldNotRouteOutboundMessageException in project mule by mulesoft.
the class FirstSuccessfulTestCase method testRouteReturnsNullMessage.
@Test
public void testRouteReturnsNullMessage() throws Exception {
Processor nullEventMp = event -> CoreEvent.builder(event).message(null).build();
FirstSuccessful fs = createFirstSuccessfulRouter(nullEventMp);
fs.setAnnotations(getAppleFlowComponentLocationAnnotations());
fs.initialise();
try {
fs.process(testEvent());
fail("Exception expected");
} catch (CouldNotRouteOutboundMessageException e) {
// this one was expected
}
}
Aggregations