Search in sources :

Example 6 with CompositeRoutingException

use of org.mule.runtime.core.privileged.routing.CompositeRoutingException in project mule by mulesoft.

the class AbstractForkJoinStrategyFactory method createCompositeRoutingException.

private CompositeRoutingException createCompositeRoutingException(List<CoreEvent> results) {
    Map<String, Message> successMap = new LinkedHashMap<>();
    Map<String, Error> errorMap = new LinkedHashMap<>();
    for (CoreEvent event : results) {
        String key = Integer.toString(event.getGroupCorrelation().get().getSequence());
        if (event.getError().isPresent()) {
            errorMap.put(key, event.getError().get());
        } else {
            successMap.put(key, event.getMessage());
        }
    }
    return new CompositeRoutingException(new RoutingResult(successMap, errorMap));
}
Also used : CompositeRoutingException(org.mule.runtime.core.privileged.routing.CompositeRoutingException) RoutingResult(org.mule.runtime.core.privileged.routing.RoutingResult) Message(org.mule.runtime.api.message.Message) CoreEvent(org.mule.runtime.core.api.event.CoreEvent) Error(org.mule.runtime.api.message.Error) LinkedHashMap(java.util.LinkedHashMap)

Aggregations

CompositeRoutingException (org.mule.runtime.core.privileged.routing.CompositeRoutingException)6 RoutingResult (org.mule.runtime.core.privileged.routing.RoutingResult)5 Description (io.qameta.allure.Description)4 Test (org.junit.Test)4 CoreEvent (org.mule.runtime.core.api.event.CoreEvent)3 RoutingPair (org.mule.runtime.core.internal.routing.ForkJoinStrategy.RoutingPair)3 TimeoutException (java.util.concurrent.TimeoutException)2 Message (org.mule.runtime.api.message.Message)2 Processor (org.mule.runtime.core.api.processor.Processor)2 ReactiveProcessor (org.mule.runtime.core.api.processor.ReactiveProcessor)2 InternalProcessor (org.mule.runtime.core.privileged.processor.InternalProcessor)2 LinkedHashMap (java.util.LinkedHashMap)1 Error (org.mule.runtime.api.message.Error)1