Package org.apache.camel

Examples of org.apache.camel.RuntimeExchangeException


                Message message = endpoint.getBinding().makeJmsMessage(exchange, in, session, null);

                // get the reply to destination to be used from the reply manager
                Destination replyTo = replyManager.getReplyTo();
                if (replyTo == null) {
                    throw new RuntimeExchangeException("Failed to resolve replyTo destination", exchange);
                }
                JmsMessageHelper.setJMSReplyTo(message, replyTo);
                replyManager.setReplyToSelectorHeader(in, message);

                String correlationId = determineCorrelationId(message, provisionalCorrelationId);
View Full Code Here


        if (jmsMessage != null && !hasPopulatedHeaders() && !name.startsWith("JMS")) {
            try {
                // use binding to do the lookup as it has to consider using encoded keys
                answer = getBinding().getObjectProperty(jmsMessage, name);
            } catch (JMSException e) {
                throw new RuntimeExchangeException("Unable to retrieve header from JMS Message: " + name, getExchange(), e);
            }
        }
        // only look if we have populated headers otherwise there are no headers at all
        // if we do lookup a header starting with JMS then force a lookup
        if (answer == null && (hasPopulatedHeaders() || name.startsWith("JMS"))) {
View Full Code Here

        }
        try {
            String id = getDestinationAsString(jmsMessage.getJMSDestination()) + jmsMessage.getJMSMessageID();
            return getSanitizedString(id);
        } catch (JMSException e) {
            throw new RuntimeExchangeException("Unable to retrieve JMSMessageID from JMS Message", getExchange(), e);
        }
    }
View Full Code Here

                Message message = endpoint.getBinding().makeJmsMessage(exchange, in, session, null);

                // get the reply to destination to be used from the reply manager
                Destination replyTo = replyManager.getReplyTo();
                if (replyTo == null) {
                    throw new RuntimeExchangeException("Failed to resolve replyTo destination", exchange);
                }
                JmsMessageHelper.setJMSReplyTo(message, replyTo);
                replyManager.setReplyToSelectorHeader(in, message);

                String correlationId = determineCorrelationId(message, provisionalCorrelationId);
View Full Code Here

        if (jmsMessage != null && !hasPopulatedHeaders() && !name.startsWith("JMS")) {
            try {
                // use binding to do the lookup as it has to consider using encoded keys
                answer = getBinding().getObjectProperty(jmsMessage, name);
            } catch (JMSException e) {
                throw new RuntimeExchangeException("Unable to retrieve header from JMS Message: " + name, getExchange(), e);
            }
        }
        // only look if we have populated headers otherwise there are no headers at all
        // if we do lookup a header starting with JMS then force a lookup
        if (answer == null && (hasPopulatedHeaders() || name.startsWith("JMS"))) {
View Full Code Here

        }
        try {
            String id = getDestinationAsString(jmsMessage.getJMSDestination()) + jmsMessage.getJMSMessageID();
            return getSanitizedString(id);
        } catch (JMSException e) {
            throw new RuntimeExchangeException("Unable to retrieve JMSMessageID from JMS Message", getExchange(), e);
        }
    }
View Full Code Here

                Message message = endpoint.getBinding().makeJmsMessage(exchange, in, session, null);

                // get the reply to destination to be used from the reply manager
                Destination replyTo = replyManager.getReplyTo();
                if (replyTo == null) {
                    throw new RuntimeExchangeException("Failed to resolve replyTo destination", exchange);
                }
                JmsMessageHelper.setJMSReplyTo(message, replyTo);
                replyManager.setReplyToSelectorHeader(in, message);

                String correlationId = determineCorrelationId(message, provisionalCorrelationId);
View Full Code Here

  public DuccEvent dispatchAndWaitForDuccReply(DuccEvent duccEvent) throws Exception {
    int maxRetryCount = 20;
    int i = 0;
    Object reply = null;
    RuntimeExchangeException ree = null;

    // retry up to 20 times. This is an attempt to handle an error thrown
    // by Camel: Failed to resolve replyTo destination on the exchange
    // Camel waits at most 10000ms( 10secs) for AMQ to create a temp queue.
    // After 10secs Camel times out and throws an Exception.
View Full Code Here

    protected Object invoke(Method mth, Object pojo, Object[] arguments, Exchange exchange) throws InvocationTargetException {
        try {
            return mth.invoke(pojo, arguments);
        } catch (IllegalAccessException e) {
            throw new RuntimeExchangeException("IllegalAccessException occurred invoking method: " + mth + " using arguments: " + Arrays.asList(arguments), exchange, e);
        } catch (IllegalArgumentException e) {
            throw new RuntimeExchangeException("IllegalArgumentException occurred invoking method: " + mth + " using arguments: " + Arrays.asList(arguments), exchange, e);
        }
    }
View Full Code Here

        try {
            template.sendBody("direct:a", "World");
            fail("Should have thrown exception");
        } catch (CamelExecutionException e) {
            RuntimeExchangeException cause = assertIsInstanceOf(RuntimeExchangeException.class, e.getCause());
            assertTrue(cause.getMessage().contains("echo(java.lang.String,int)"));
            assertTrue(cause.getMessage().contains("[World, null]"));
            assertIsInstanceOf(IllegalArgumentException.class, cause.getCause());
        }

        assertMockEndpointsSatisfied();
    }
View Full Code Here

TOP

Related Classes of org.apache.camel.RuntimeExchangeException

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.