Package org.mule.api.routing

Examples of org.mule.api.routing.CouldNotRouteOutboundMessageException


        {
            throw e;
        }
        catch (MuleException e)
        {
            throw new CouldNotRouteOutboundMessageException(event, ep, e);
        }
        return result;
    }
View Full Code Here


                {
                    EndpointURI newUri = new MuleEndpointURI(newUriString, muleContext);
                    EndpointURI endpointURI = ep.getEndpointURI();
                    if (endpointURI != null && !newUri.getScheme().equalsIgnoreCase(endpointURI.getScheme()))
                    {
                        throw new CouldNotRouteOutboundMessageException(
                            CoreMessages.schemeCannotChangeForRouter(ep.getEndpointURI().getScheme(),
                                newUri.getScheme()), event, ep);
                    }
                    newUri.initialise();

                    return new DynamicURIOutboundEndpoint(ep, newUri);
                }
                catch (EndpointException e)
                {
                    throw new CouldNotRouteOutboundMessageException(
                        CoreMessages.templateCausedMalformedEndpoint(uri, newUriString), event, ep, e);
                }
                catch (InitialisationException e)
                {
                    throw new CouldNotRouteOutboundMessageException(
                        CoreMessages.templateCausedMalformedEndpoint(uri, newUriString), event, ep, e);
                }
            }
        }
    }
View Full Code Here

    public MuleEvent route(MuleEvent event) throws MessagingException
    {
        int modulo = getAndIncrementModuloN(routes.size());
        if (modulo < 0)
        {
            throw new CouldNotRouteOutboundMessageException(event, this);
        }
       
        MessageProcessor mp = routes.get(modulo);
        try
        {
View Full Code Here

            }
        }

        if (failed)
        {
            throw new CouldNotRouteOutboundMessageException(event, this);
        }

        return returnEvent;
    }
View Full Code Here

            }
            result = sendRequest(event, message, ep, true);
        }
        catch (MuleException e)
        {
            throw new CouldNotRouteOutboundMessageException(event, routes.get(0), e);
        }

        return result;
    }
View Full Code Here

                    sendRequest(event, request, endpoint, false);
                }
            }
            catch (MuleException e)
            {
                throw new CouldNotRouteOutboundMessageException(event, endpoint, e);
            }
        }

        return resultsHandler.aggregateResults(results, event, muleContext);
    }
View Full Code Here

                    sendRequest(event, sendMessage, part.getEndpoint(), false);
                }
            }
            catch (MuleException e)
            {
                throw new CouldNotRouteOutboundMessageException(event, part.getEndpoint(), e);
            }
        }

        return resultsHandler.aggregateResults(results, event, muleContext);
    }
View Full Code Here

    protected List getRecipients(MuleEvent event) throws CouldNotRouteOutboundMessageException
    {
        String expr = getFullExpression();
        if (!muleContext.getExpressionManager().isValidExpression(expr))
        {
            throw new CouldNotRouteOutboundMessageException(
                    CoreMessages.expressionInvalidForProperty("expression", expr), event, null);
        }

        Object msgRecipients = muleContext.getExpressionManager().evaluate(expr, event.getMessage());
        if (msgRecipients == null)
        {
            throw new CouldNotRouteOutboundMessageException(
                    CoreMessages.propertyIsNotSetOnEvent(getFullExpression()), event, null);
        }
        else if (msgRecipients instanceof String)
        {
            return Arrays.asList(StringUtils.splitAndTrim(msgRecipients.toString(), " ,;:"));
        }
        else if (msgRecipients instanceof List)
        {
            return new ArrayList((List) msgRecipients);
        }
        else
        {
            logger.error("Recipients on message are neither String nor List but: " + msgRecipients.getClass());
            throw new CouldNotRouteOutboundMessageException(
                    CoreMessages.propertyIsNotSupportedType(getFullExpression(), new Class[]{String.class, List.class}, msgRecipients.getClass()), event, null);
        }
    }
View Full Code Here

            }

        }
        catch (MuleException e)
        {
            throw new CouldNotRouteOutboundMessageException(event, endpoint, e);
        }
        return resultToReturn;
    }
View Full Code Here

                boolean lastEndpoint = !iterator.hasNext();
   
                // TODO MULE-4476
                if (!lastEndpoint && !endpoint.getExchangePattern().hasResponse())
                {
                    throw new CouldNotRouteOutboundMessageException(
                        MessageFactory.createStaticMessage("The ExceptionBasedRouter does not support asynchronous endpoints, make sure all endpoints on the router are configured as synchronous"), event, endpoint);
                }
               
                if (endpoint.getExchangePattern().hasResponse())
                {
                    MuleMessage resultMessage = null;
                    result = sendRequest(event, request, endpoint, true);
                    if (result != null)
                    {
                        resultMessage = result.getMessage();
                    }
                    if (resultMessage != null)
                    {
                        resultMessage.applyTransformers(result, endpoint.getResponseTransformers());
                    }
                    if (!exceptionPayloadAvailable(resultMessage))
                    {
                        if (logger.isDebugEnabled())
                        {
                            logger.debug("Successful invocation detected, stopping further processing.");
                        }
                        success = true;
                        break;
                    }
                }
                else
                {
                    sendRequest(event, request, endpoint, false);
                    success = true;
                    break;
                }
            }
            catch (MuleException e)
            {
                logger.info("Failed to send/dispatch to endpoint: " + endpoint.getEndpointURI().toString()
                            + ". Error was: " + e.getMessage() + ". Trying next endpoint");
            }
        }

        if (!success)
        {
            throw new CouldNotRouteOutboundMessageException(event, endpoint);
        }

        return result;
    }
View Full Code Here

TOP

Related Classes of org.mule.api.routing.CouldNotRouteOutboundMessageException

Copyright © 2018 www.massapicom. 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.