Search in sources :

Example 6 with RoutingException

use of org.mule.runtime.core.privileged.routing.RoutingException 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);
    }
}
Also used : CouldNotRouteOutboundMessageException(org.mule.runtime.core.privileged.routing.CouldNotRouteOutboundMessageException) RoutingException(org.mule.runtime.core.privileged.routing.RoutingException) Processor(org.mule.runtime.core.api.processor.Processor) MuleException(org.mule.runtime.api.exception.MuleException)

Aggregations

RoutingException (org.mule.runtime.core.privileged.routing.RoutingException)6 CoreEvent (org.mule.runtime.core.api.event.CoreEvent)4 MuleException (org.mule.runtime.api.exception.MuleException)3 Test (org.junit.Test)2 DefaultMuleException (org.mule.runtime.api.exception.DefaultMuleException)2 Processor (org.mule.runtime.core.api.processor.Processor)2 MessagingException (org.mule.runtime.core.internal.exception.MessagingException)2 ArrayList (java.util.ArrayList)1 MuleRuntimeException (org.mule.runtime.api.exception.MuleRuntimeException)1 InitialisationException (org.mule.runtime.api.lifecycle.InitialisationException)1 Message (org.mule.runtime.api.message.Message)1 RoutingNotification (org.mule.runtime.api.notification.RoutingNotification)1 ObjectAlreadyExistsException (org.mule.runtime.api.store.ObjectAlreadyExistsException)1 ObjectDoesNotExistException (org.mule.runtime.api.store.ObjectDoesNotExistException)1 ObjectStoreException (org.mule.runtime.api.store.ObjectStoreException)1 EventGroup (org.mule.runtime.core.internal.routing.EventGroup)1 DispatchException (org.mule.runtime.core.privileged.connector.DispatchException)1 RegistrationException (org.mule.runtime.core.privileged.registry.RegistrationException)1 CouldNotRouteOutboundMessageException (org.mule.runtime.core.privileged.routing.CouldNotRouteOutboundMessageException)1