Package org.apache.camel.component.jms

Examples of org.apache.camel.component.jms.JmsExchange


        container.start();
       
        // Send a message to the JMS endpoint
        JmsEndpoint endpoint = (JmsEndpoint) container.getEndpoint("jms:test");       
        Producer<JmsExchange> producer = endpoint.createProducer();
        JmsExchange exchange = producer.createExchange();
        JmsMessage in = exchange.getIn();
        in.setBody("Hello");
        in.setHeader("cheese", 123);
        producer.process(exchange);
       
        // The Activated endpoint should send it to the pojo due to the configured route.
View Full Code Here


        return new RouteBuilder() {
            public void configure() throws Exception {
                from("activemq:test.a").process(new Processor() {
                    public void process(Exchange exchange) throws Exception {
                        // lets set the custom JMS headers using the JMS API
                        JmsExchange jmsExchange = assertIsInstanceOf(JmsExchange.class, exchange);
                        Message inMessage = jmsExchange.getInMessage();
                        inMessage.setJMSReplyTo(replyQueue);
                        inMessage.setJMSCorrelationID(correlationID);
                        inMessage.setJMSType(messageType);
                    }
                }).to("activemq:test.b");
View Full Code Here

        } else {
            // TODO support any CamelDestination?
            throw new IllegalArgumentException("Invalid destination setting: " + destination + " when expected: " + this.destination);
        }
        try {
            JmsExchange exchange = new JmsExchange(endpoint.getContext(), ExchangePattern.InOnly, camelDestination.getBinding(), message);
            producer.process(exchange);
        } catch (JMSException e) {
            throw e;
        } catch (Exception e) {
            throw JMSExceptionSupport.create(e);
View Full Code Here

        } else {
            // TODO support any CamelDestination?
            throw new IllegalArgumentException("Invalid destination setting: " + destination + " when expected: " + this.destination);
        }
        try {
            JmsExchange exchange = new JmsExchange(endpoint.getCamelContext(), ExchangePattern.InOnly, camelDestination.getBinding(), message);
            producer.process(exchange);
        } catch (JMSException e) {
            throw e;
        } catch (Exception e) {
            throw JMSExceptionSupport.create(e);
View Full Code Here

        return new RouteBuilder() {
            public void configure() throws Exception {
                from("activemq:test.a").process(new Processor() {
                    public void process(Exchange exchange) throws Exception {
                        // lets set the custom JMS headers using the JMS API
                        JmsExchange jmsExchange = assertIsInstanceOf(JmsExchange.class, exchange);
                        Message inMessage = jmsExchange.getInMessage();
                        inMessage.setJMSReplyTo(replyQueue);
                        inMessage.setJMSCorrelationID(correlationID);
                        inMessage.setJMSType(messageType);
                    }
                }).to("activemq:test.b");
View Full Code Here

        container.start();
       
        // Send a message to the JMS endpoint
        JmsEndpoint endpoint = (JmsEndpoint) container.getEndpoint("jms:test");       
        Producer<JmsExchange> producer = endpoint.createProducer();
        JmsExchange exchange = producer.createExchange();
        JmsMessage in = exchange.getIn();
        in.setBody("Hello");
        in.setHeader("cheese", 123);
        producer.process(exchange);
       
        // The Activated endpoint should send it to the pojo due to the configured route.
View Full Code Here

        return new RouteBuilder() {
            public void configure() throws Exception {
                from("activemq:test.a").process(new Processor() {
                    public void process(Exchange exchange) throws Exception {
                        // lets set the custom JMS headers using the JMS API
                        JmsExchange jmsExchange = assertIsInstanceOf(JmsExchange.class, exchange);
                        Message inMessage = jmsExchange.getInMessage();
                        inMessage.setJMSReplyTo(replyQueue);
                        inMessage.setJMSCorrelationID(correlationID);
                        inMessage.setJMSType(messageType);
                    }
                // must set option to preserve message QoS as we send an InOnly but put a JMSReplyTo
View Full Code Here

TOP

Related Classes of org.apache.camel.component.jms.JmsExchange

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.