Examples of RoutingException


Examples of org.mule.api.routing.RoutingException

                {
                    throw e;
                }
                catch (Exception e)
                {
                    throw new RoutingException(event, AbstractOutboundRouter.this, e);
                }
            }
        };
        try
        {
View Full Code Here

Examples of org.mule.api.routing.RoutingException

        {
            throw me;
        }
        catch (Exception e)
        {
            throw new RoutingException(routedEvent, null, e);
        }

        if (getRouterStatistics() != null)
        {
            if (getRouterStatistics().isEnabled())
View Full Code Here

Examples of org.mule.api.routing.RoutingException

        {
            throw me;
        }
        catch (Exception e)
        {
            throw new RoutingException(routedEvent, null, e);
        }

        if (result != null && !VoidMuleEvent.getInstance().equals(result))
        {
            MuleMessage resultMessage = result.getMessage();
View Full Code Here

Examples of org.mule.api.routing.RoutingException

        {
            return mp.process(event);
        }
        catch (MuleException ex)
        {
            throw new RoutingException(event, this, ex);
        }
    }
View Full Code Here

Examples of org.mule.api.routing.RoutingException

    @Override
    protected void doDispatch(MuleEvent event) throws Exception
    {
        if (endpoint.getEndpointURI().toString().equals("test://AlwaysFail"))
        {
            throw new RoutingException(event, (OutboundEndpoint) endpoint);
        }
    }
View Full Code Here

Examples of org.mule.api.routing.RoutingException

    @Override
    protected MuleMessage doSend(MuleEvent event) throws Exception
    {
        if (endpoint.getEndpointURI().toString().equals("test://AlwaysFail"))
        {
            throw new RoutingException(event, (OutboundEndpoint) endpoint);
        }
        return event.getMessage();
    }
View Full Code Here

Examples of org.mule.api.routing.RoutingException

                    {
                        Thread.sleep(getUntilSuccessfulConfiguration().getMillisBetweenRetries());
                    }
                }
            }
            throw new RoutingException(event, getUntilSuccessfulConfiguration().getRouter(), lastExecutionException);
        }
        catch (MessagingException e)
        {
            throw e;
        }
        catch (Exception e)
        {
            throw new RoutingException(event, getUntilSuccessfulConfiguration().getRouter(), e);
        }
    }
View Full Code Here

Examples of org.mule.api.routing.RoutingException

public class ExceptionThrowingOutboundRouter extends OutboundPassThroughRouter
{
    public MuleEvent process(MuleEvent event) throws MuleException
    {
        throw new RoutingException(MessageFactory.createStaticMessage("dummyException"), event, null);
    }
View Full Code Here

Examples of org.mule.api.routing.RoutingException

    @Test
    public final void testRoutingExceptionNullMessageValidEndpoint() throws MuleException
    {
        OutboundEndpoint endpoint = Mockito.mock(OutboundEndpoint.class);

        RoutingException rex = new RoutingException(null, endpoint);
        assertSame(endpoint, rex.getRoute());
    }
View Full Code Here

Examples of org.mule.api.routing.RoutingException

                // ignore
            }
        }
        if (groupId == null || groupId.equals("-1"))
        {
            throw new RoutingException(CoreMessages.noCorrelationId(), event, timeoutMessageProcessor);
        }

        // spinloop for the EventGroup lookup
        while (true)
        {
            try
            {
                if (isGroupAlreadyProcessed(groupId))
                {
                    if (logger.isDebugEnabled())
                    {
                        logger.debug("An event was received for an event group that has already been processed, "
                                     + "this is probably because the async-reply timed out. Correlation Id is: "
                                     + groupId + ". Dropping event");
                    }
                    // Fire a notification to say we received this message
                    muleContext.fireNotification(new RoutingNotification(event.getMessage(),
                                                                         event.getMessageSourceURI().toString(),
                                                                         RoutingNotification.MISSED_AGGREGATION_GROUP_EVENT));
                    return null;
                }
            }
            catch (ObjectStoreException e)
            {
                throw new RoutingException(event, timeoutMessageProcessor, e);
            }

            // check for an existing group first
            EventGroup group;
            try
            {
                group = this.getEventGroup(groupId);
            }
            catch (ObjectStoreException e)
            {
                throw new RoutingException(event, timeoutMessageProcessor, e);
            }

            // does the group exist?
            if (group == null)
            {
                // ..apparently not, so create a new one & add it
                try
                {
                    group = this.addEventGroup(callback.createEventGroup(event, groupId));
                }
                catch (ObjectStoreException e)
                {
                    throw new RoutingException(event, timeoutMessageProcessor, e);
                }
            }

            // ensure that only one thread at a time evaluates this EventGroup
            synchronized (groupsLock)
            {
                if (logger.isDebugEnabled())
                {
                    logger.debug("Adding event to aggregator group: " + groupId);
                }

                // add the incoming event to the group
                try
                {
                    group.addEvent(event);
                }
                catch (ObjectStoreException e)
                {
                    throw new RoutingException(event, timeoutMessageProcessor, e);
                }

                // check to see if the event group is ready to be aggregated
                if (callback.shouldAggregateEvents(group))
                {
                    // create the response event
                    MuleEvent returnEvent = callback.aggregateEvents(group);
                    returnEvent.getMessage().setCorrelationId(groupId);
                    String rootId = group.getCommonRootId();
                    if (rootId != null)
                    {
                        returnEvent.getMessage().setMessageRootId(rootId);
                    }

                    // remove the eventGroup as no further message will be received
                    // for this group once we aggregate
                    try
                    {
                        this.removeEventGroup(group);
                        group.clear();
                    }
                    catch (ObjectStoreException e)
                    {
                        throw new RoutingException(event, timeoutMessageProcessor, e);
                    }

                    return returnEvent;
                }
                else
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.