if (!(event.getFlowConstruct() instanceof Service))
{
throw new UnsupportedOperationException("ForwardingConsumer is only supported with Service");
}
MessageProcessor processor = ((Service) event.getFlowConstruct()).getOutboundMessageProcessor();
// Set the stopFurtherProcessing flag to true to inform the
// DefaultInboundRouterCollection not to route these events to the service
event.setStopFurtherProcessing(true);
if (processor == null)
{
logger.debug("Descriptor has no outbound router configured to forward to, continuing with normal processing");
return event;
}
else
{
try
{
MuleEvent resultEvent = processor.process(event);
if (resultEvent != null)
{
return resultEvent;
}
else