I am using simple Java to post messages. Heres the code:

        //Reading the camel config from the spring config file
        ApplicationContext context = new
ClassPathXmlApplicationContext("camel-client.xml");
        CamelContext camel = context.getBean("camel-client",
CamelContext.class);

        Endpoint endpoint = camel.getEndpoint("activemq:queue:numbers");

        
        Exchange exchange = endpoint.createExchange(ExchangePattern.InOut);
        // set the input on the in body
       String request = "{MessageId:A0FA0DC53957743EE040100A0E540E97,  
EventType:Event1} ";

        exchange.getIn().setBody(request);
       
        // to send the exchange we need an producer to do it for us
        Producer producer = endpoint.createProducer();
        // 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
       
        String response = exchange.getOut().getBody(String.class);

I have been sending only Event1 to the queue



--
View this message in context: 
http://camel.465427.n5.nabble.com/Different-response-messages-tp5736239p5736302.html
Sent from the Camel - Users mailing list archive at Nabble.com.

Reply via email to