On Mon, Nov 15, 2010 at 4:10 PM, Krystian <[email protected]> wrote: > > Hmmm > > It seems not to work - adding concurrentConsumers option. But it's probably > because I am adding it in wrong place. > I don't have any routes configured. > It's a very simple test code, two pojos: > > class PojoProducer { > �...@produce(uri="activemq:entryQueue") > ProducerTemplate producer > > public void send(Map what) { > println("RESPONSE: ${producer.sendBody("activemq:entryQueue", > ExchangePattern.InOut, what)}") > } > } > > > class PojoConsumer { > �...@consume(uri="activemq:entryQueue?concurrentConsumers=10") > public Map consume(Map body) { > println("READ: $body") > Thread.sleep(100) > return ["response":body["request"]] > } > } > > [yeah, it's in groovy]. > > So i basically call the producer.send 10 times. However everything seems to > be done synchronously, as this is the system.out I am getting: > READ: [request:0] > RESPONSE: [response:0] > READ: [request:1] > RESPONSE: [response:1] > READ: [request:2] > RESPONSE: [response:2] > READ: [request:3] > RESPONSE: [response:3] > [...] > > I've added ?concurrentConsumers=10 to both, Consume and Produce annotations > but this didn't change a thing. Do I have to create a route in order to make > this work?
Hmm could you try sleeping 2 sec to be absolutely sure. You may have hit a corner case here. If its a route then it definitely works. The concurrentConsumer options is for the Spring DMLC so it ought not to affect Camel when using @Consume or from a route. Anyway dig a bit more and report back. > -- > View this message in context: > http://camel.465427.n5.nabble.com/How-to-get-configure-concurrent-consumers-for-POJO-with-Consume-tp3265743p3265797.html > Sent from the Camel - Users mailing list archive at Nabble.com. > -- Claus Ibsen ----------------- FuseSource Email: [email protected] Web: http://fusesource.com Twitter: davsclaus Blog: http://davsclaus.blogspot.com/ Author of Camel in Action: http://www.manning.com/ibsen/
