camel-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From bocamel <>
Subject Why does ConsumerTemplate.receiveBody receive more than one message at a time from SEDA queue?
Date Sun, 05 Jan 2014 17:48:18 GMT
When using a consumer template to receive messages from seda queue, a single
receiveBody (or receiveBodyNoWait) seems to consume more than one message
from the queue.  Here is a sample processor:

SedaEndpoint queueEp = (SedaEndpoint)

ConsumerTemplate cTemplate = (ConsumerTemplate)  

System.out.println("seda queue size before receive: " +
String msgBody = cTemplate.receiveBody(queueEp, 10, String.class);
System.out.println("seda queue size after receive: " +

The output is the following:

seda queue size before receive: 5
seda queue size after receive: 0

Should the receiveBody receive one message each time?  The above processor
is running under a single Camel Timer thread.   Here are the routes (the
above code is in testProc):

  <camel:camelContext xmlns="">

	<camel:consumerTemplate id="cTemplate" />

      <camel:from uri="file:src/data?noop=true"/>
      <camel:to uri="seda:test" />
    	<camel:from uri="timer://foo?period=500000" />
    	<camel:process ref="testProc"/>

Have I missed anything?  Thanks for any help!

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

View raw message