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
> 

                                          

Reply via email to