You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@camel.apache.org by "Mike L." <pa...@hotmail.com> on 2011/04/02 00:51:52 UTC
RE: InOut over JMS always leads to Timout
(ExchangeTimedOutException)
Claus:
Once again, thank you for your reply.
Even my real-world application processes the messages much, much faster than 20 seconds. However, I can also replicate the problem using the sample class below (which reads the in message, appends a String to it, and returns the result). So, as I mentioned in a previous post, I believe it shows a problem consuming messages.
Interestingly, if I modify the ActiveMQ log4j.properties file, then the error rate goes down to < 1%. Normally, the error rate is 15-30% - significantly different!
public class HelloProcessor implements Processor {
private static final Log LOG = LogFactory.getLog(HelloProcessor.class);
public void process(org.apache.camel.Exchange exchange) {
String inMsg = getInputMessage(exchange);
String outMsg = new String("hello " + inMsg);
//exchange.getIn().setBody(outMsg); // this didn't work out so well...
// change the message to say Hello
exchange.getOut().setBody(outMsg);
// copy headers from IN to OUT to propagate them
exchange.getOut().setHeaders(exchange.getIn().getHeaders());
}
String getInputMessage(org.apache.camel.Exchange exchange) {
String content = exchange.getIn().getBody(String.class);
if (content != null) return content;
return "";
}
}
If you could run the sample classes I sent in the original post you can see for yourself how often synchronous messaging over JMS using Camel times out. If it would help, I could try to "Mavenize" the project so you wouldn't have to put all the dependent jars in the project.
Thanks,
Mike L. (aka patzerbud)
>
> If the processing of the messages is very slow then you can set a
> higher value for the timeout (20 sec by default)
>
> Its the requestTimeout option
> http://camel.apache.org/jms
>
RE: InOut over JMS always leads to Timout
(ExchangeTimedOutException)
Posted by "Mike L." <pa...@hotmail.com>.
So, further testing has revealed that it was not my configuration file. Instead I found differences based on the version of ActiveMQ I used:
5.3.1 works fine
5.3.2 works fine
5.4.2 fails ~30% of the time
5.5.0 works fine
> To: users@camel.apache.org
> Subject: RE: InOut over JMS always leads to Timout (ExchangeTimedOutException)
> Date: Sat, 2 Apr 2011 13:47:48 -0500
>
>
> All:
>
> I just downloaded and installed ActiveMQ 5.5.0 and when I ran my test it passed!
>
> Although it could be that the new version of ActiveMQ fixed the problem - right now I suspect my activemq.xml configuration was in some way causing this. I will do more investigation and report back with my findings.
>
> Thanks to everyone who replied.
>
> Mike L. (aka patzerbud)
>
>
RE: InOut over JMS always leads to Timout
(ExchangeTimedOutException)
Posted by "Mike L." <pa...@hotmail.com>.
All:
I just downloaded and installed ActiveMQ 5.5.0 and when I ran my test it passed!
Although it could be that the new version of ActiveMQ fixed the problem - right now I suspect my activemq.xml configuration was in some way causing this. I will do more investigation and report back with my findings.
Thanks to everyone who replied.
Mike L. (aka patzerbud)
RE: InOut over JMS always leads to Timout
(ExchangeTimedOutException)
Posted by "Mike L." <pa...@hotmail.com>.
I ran a test with DEBUG logging turned on and have attached the output. As you can see below 6 out of 20 messages failed.
2011-04-02 11:12:16,998 INFO [main] (HelloPublisher.java:58) -response: hello John 1
2011-04-02 11:12:33,454 INFO [main] (HelloPublisher.java:58) -response: hello John 2
2011-04-02 11:12:53,616 INFO [main] (HelloPublisher.java:58) -response: hello John 4
2011-04-02 11:13:03,441 INFO [main] (HelloPublisher.java:58) -response: hello John 5
2011-04-02 11:13:23,670 INFO [main] (HelloPublisher.java:58) -response: hello John 7
2011-04-02 11:13:23,727 INFO [main] (HelloPublisher.java:58) -response: hello John 8
2011-04-02 11:13:33,441 INFO [main] (HelloPublisher.java:58) -response: hello John 9
2011-04-02 11:13:53,731 INFO [main] (HelloPublisher.java:58) -response: hello John 11
2011-04-02 11:14:03,441 INFO [main] (HelloPublisher.java:58) -response: hello John 12
2011-04-02 11:14:23,806 INFO [main] (HelloPublisher.java:58) -response: hello John 14
2011-04-02 11:14:33,440 INFO [main] (HelloPublisher.java:58) -response: hello John 15
2011-04-02 11:14:53,861 INFO [main] (HelloPublisher.java:58) -response: hello John 17
2011-04-02 11:15:03,441 INFO [main] (HelloPublisher.java:58) -response: hello John 18
2011-04-02 11:15:23,922 INFO [main] (HelloPublisher.java:58) -response: hello John 20
Any help would be greatly appreciated!
TIA,
Mike L. (aka patzerbud)