camel-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From scrutinizer <>
Subject Multithreading bug: getBody sporadically returns null
Date Tue, 04 May 2010 12:29:14 GMT

I have a simple route that processes a file by splitting on a tag and
processing the DOM of each split message. The problem is that getBody is
randomly returning null but ONLY when using the parallelProcessing feature
of split. For some runs of the same XML file, the error does not occur at
all (the file is about 2MB of data), others it will happen once or twice. I
am currently using the latest 2.3-SNAPSHOT.

Has anyone seen this problem?

Also note, that after detecting the null, I tried calling
getBody(String.class) - this also may return null. Sometimes it does return
the proper XML.

(I would post to the Camel bug list but it is currently down - will post
once it's up)

Route configuration that reproduces the problem (my input XML is about 2MB
with about 500 article tags):

        public void configure() throws Exception {
            .split(new XPathBuilder("//article"))
              .parallelProcessing()                     // remove this line
getBody below never returns null
              .process(new Processor() {
                public void process(Exchange exchange) throws Exception {
                  Message inMessage = exchange.getIn();
                  org.w3c.dom.Document domDocument =
                  if (domDocument == null) {
                    log("Null body");
                  } else {
                    // process DOM here

View this message in context:
Sent from the Camel - Users mailing list archive at

View raw message