Package org.apache.camel

Examples of org.apache.camel.Producer.process()


                Producer producer;
                try {
                    producer = endpoint.createProducer();
                    producer.start();
                    producer.process(exchange);
                    producer.stop();
                } catch (Exception e) {
                    throw ObjectHelper.wrapRuntimeCamelException(e);
                }
View Full Code Here


        // start the producer so it can operate
        producer.start();

        // let the producer process the exchange where it does all the work in this oneline of code
       
        producer.process(exchange);

        // get the response from the out body and cast it to an integer
        int response = exchange.getOut().getBody(Integer.class);
       
        assertEquals("Get a wrong response.", 33, response);
View Full Code Here

        // FIX message to send
        Email email = new Email(new EmailThreadID("ID"), new EmailType(EmailType.NEW), new Subject("Test"));
        Exchange exchange = producer.createExchange(ExchangePattern.InOnly);
        exchange.getIn().setBody(email);
       
        producer.process(exchange);           

        // Produce with no session ID specified, session ID must be in message
        Producer producer2 = endpoint.createProducer();
        
        email.getHeader().setString(SenderCompID.FIELD, acceptorSessionID.getSenderCompID());
View Full Code Here

        Producer producer2 = endpoint.createProducer();
        
        email.getHeader().setString(SenderCompID.FIELD, acceptorSessionID.getSenderCompID());
        email.getHeader().setString(TargetCompID.FIELD, acceptorSessionID.getTargetCompID());

        producer2.process(exchange);
      
        assertTrue("Messages not received", messageLatch.await(5000, TimeUnit.MILLISECONDS));
    }

    @Test
View Full Code Here

                Producer producer;
                try {
                    producer = endpoint.createProducer();
                    producer.start();
                    producer.process(exchange);
                    producer.stop();
                } catch (Exception e) {
                    throw ObjectHelper.wrapRuntimeCamelException(e);
                }
View Full Code Here

        exchange.setProperty("ham", "old");
        exchange.setProperty("setException", setException);

        Producer producer = endpoint.createProducer();
        producer.start();
        producer.process(exchange);

        return exchange;
    }

    private void assertExchange(Exchange exchange, boolean hasFault) {
View Full Code Here

        Exchange exchange = endpoint.createExchange();
        if (header != null) {
            exchange.getIn().setHeader("foo", header);
        }
        Producer producer = endpoint.createProducer();
        producer.process(exchange);

        log.debug("Interceptor invocation order:" + order);
        assertEquals(expected, order);
    }
View Full Code Here

                Producer producer;
                try {
                    producer = endpoint.createProducer();
                    producer.start();
                    producer.process(exchange);
                    producer.stop();
                } catch (Exception e) {
                    throw ObjectHelper.wrapRuntimeCamelException(e);
                }
View Full Code Here

        Producer producer = endpoint.createProducer();
        Exchange exchange = producer.createExchange();
        exchange.getIn().setBody(hello);

        producer.start();
        producer.process(exchange);
        producer.stop();

        String s = exchange.getOut().getBody(String.class);
        assertEquals(bye, s);
    }
View Full Code Here

        Producer producer = endpoint.createProducer();
        producer.start();

        // set input and execute it
        exchange.getIn().setBody("Hello World");
        producer.process(exchange);

        Field field = producer.getClass().getDeclaredField("session");
        field.setAccessible(true);
        IoSession session = (IoSession) field.get(producer);
        assertTrue("There should be a logger filter", session.getFilterChain().contains("logger"));
View Full Code Here

TOP
Copyright © 2018 www.massapi.com. 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.