public class ExceptionBasedRouter extends FilteringOutboundRouter
ExceptionBasedRouter
Will send the current event to the first
endpoint that doesn't throw an exception. If all attempted endpoints fail then an
exception is thrown. The router will override the sync/async mode of the
endpoint and force the sync mode for all endpoints except the last one.
remoteSync
is also enforced.ENABLE_CORRELATION_ALWAYS, ENABLE_CORRELATION_IF_NOT_SET, ENABLE_CORRELATION_NEVER, enableCorrelation, endpoints, logger, messageInfoMapping, replyTo, transactionConfig
muleContext
PHASE_NAME
PHASE_NAME
Constructor and Description |
---|
ExceptionBasedRouter() |
Modifier and Type | Method and Description |
---|---|
protected TransactionTemplate |
createTransactionTemplate(MuleSession session,
ImmutableEndpoint endpoint) |
protected boolean |
exceptionPayloadAvailable(MuleMessage message) |
MuleMessage |
route(MuleMessage message,
MuleSession session,
boolean synchronous)
This method is responsible for routing the Message via the MuleSession.
|
addEndpoint, getEndpoint, getFilter, getTransformers, isMatch, isUseTemplates, setFilter, setTransformers, setUseTemplates
dispatch, getEnableCorrelation, getEndpoint, getEndpoints, getMessageInfoMapping, getReplyTo, getTransactionConfig, isDynamicEndpoints, removeEndpoint, send, setEnableCorrelation, setEnableCorrelationAsString, setEndpoints, setMessageInfoMapping, setMessageProperties, setReplyTo, setTransactionConfig
dispose, getMuleContext, getRouterStatistics, initialise, setMuleContext, setRouterStatistics
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
getRouterStatistics, setRouterStatistics
initialise
dispose
public MuleMessage route(MuleMessage message, MuleSession session, boolean synchronous) throws RoutingException
OutboundRouter
route
in interface OutboundRouter
route
in class FilteringOutboundRouter
message
- the message to send via one or more endpoints on this routersession
- the session used to actually send the eventsynchronous
- whether the invocation process should be synchronous or notRoutingException
FilteringOutboundRouter
,
ExceptionBasedRouter
,
MulticastingRouter
protected boolean exceptionPayloadAvailable(MuleMessage message)
message
- message to checkprotected TransactionTemplate createTransactionTemplate(MuleSession session, ImmutableEndpoint endpoint)
createTransactionTemplate
in class AbstractOutboundRouter
Copyright © 2003–2013 MuleSource, Inc.. All rights reserved.