Am trying out the JMS example bundled with Apache Camel
ApplicationContext context = new ClassPathXmlApplicationContext("camel-config.xml");
producer)
ProducerTemplate camelTemplate = context.getBean("camelTemplate", ProducerTemplate.class);
System.out.println("Invoking the multiply with 22");
int responseData = (Integer)camelTemplate.sendBody("jms:queue:numbers", ExchangePattern.InOut, 22);
System.out.println("... the result is: " + responseData);
This is the code. This works perfectly when I run in as a standalone application.
The same thing I just put in a servlet and tried running it. I got this error
The OUT message was not received within
This was really a Blunder I made.
Thought of deleting the question. But many might do the same mistake
The problem was with the above line. Am passing 22 as parameter which is an Integer, but the real method in the JSM was receiving a InputStream as argument.
When I changed it , the problem got resolved.