Hi I had an issue with Apache Camel that timeouts for after 20 seconds.
I was getting timeout errors after 20 seconds. I have a custom processor the implements Processor. I injected a DAO and when finding the data within the custom processor it took longer to find the data on the Apache Camel side and it timed out. If I run the same code without Apache Camel it runs instantly. By doing a SELECT inside the CustomProcessor it took longer to find the data. The memory reference for the DAO are the same, so in the test the data is fetched immediately and the CustomProcessor hangs for 20 seconds before the data is receieved and it throws an Exception. I figured out that I need to add ?disableReplyTo=true as below: source=activemq:queue:notification?disableReplyTo=true This fixed the timeout issue, but nothing was being added to the queue. When I request the body of the message it returns the input XML that was sent. By default, by adding ?disableReplyTo=true sets the ExchangePattern to InOnly. Is there any way of overriding this to ExchangePattern.OutOnly? I want the message to be sent to the queue and also I want to get the body of the message that is set through producerTemplate.requestBody(). What I noted that going from one processor to another the other processor can access the exchange.setOut() as as exchange.getIn(). I have located the code on Githib: https://github.com/rajivj2/example2 I tried something like this: public class ContentEnricherProcessor implements Processor { @Resource private StatusDAO statusDAO; private Logger logger; public ContentEnricherProcessor(StatusDAO statusDAO) { this.statusDAO = statusDAO; logger = LoggerFactory.getLogger(ContentEnricherProcessor.class); } public void process(Exchange exchange) throws Exception { exchange.setPattern(ExchangePattern.OutOnly); // by doing producerTemplate.requestBody() this does not work Message message = exchange.getIn(); Entity entity = (Entity) message.getBody(); Status status = process(entity); message.setBody(status); exchange.setOut(message); } I hope you can help. -- View this message in context: http://camel.465427.n5.nabble.com/Apache-Camel-overriding-Exchange-OutOnly-behaviour-to-return-body-tp5756319.html Sent from the Camel - Users mailing list archive at Nabble.com.
