You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@camel.apache.org by huntc <hu...@mac.com> on 2008/10/27 13:52:56 UTC

activemq endpoint and thread pools

Hi there,

If I do something like this:


from("activemq:queue:myqueue").thread(2).process(new Processor() {
	public void process(Exchange exchange) throws Exception {
		Thread.sleep(1000);
	}
})...do something else


...then should that mean that I can have two processors processing messages
concurrently?

I ask because it appears that only one thread is being used.

I'm using Camel 1.4. Thanks for any clarification.

Kind regards,
Christopher
-- 
View this message in context: http://www.nabble.com/activemq-endpoint-and-thread-pools-tp20187089s22882p20187089.html
Sent from the Camel - Users mailing list archive at Nabble.com.

RE: activemq endpoint and thread pools

Posted by Claus Ibsen <ci...@silverbullet.dk>.
Hi

I have created a ticket in JIRA to improve the docs:
https://issues.apache.org/activemq/browse/CAMEL-1032


Med venlig hilsen
 
Claus Ibsen
......................................
Silverbullet
Skovsgårdsvænget 21
8362 Hørning
Tlf. +45 2962 7576
Web: www.silverbullet.dk

-----Original Message-----
From: Claus Ibsen [mailto:ci@silverbullet.dk] 
Sent: 27. oktober 2008 21:20
To: camel-user@activemq.apache.org
Subject: RE: activemq endpoint and thread pools

Hi

There is a FAQ entry also, but I guess it is a bit hard to find this gem as it's the consumer that is responsible for concurrency, and not the thread pool.

http://activemq.apache.org/camel/why-does-my-jms-route-only-consume-one-message-at-once.html

Also the jms component has some documentation how to configure concurrency:
http://activemq.apache.org/camel/jms.html 

And some notes about concurrency here:
http://activemq.apache.org/camel/parallel-processing-and-ordering.html

A good tip is to use the search inputbox (menu to the right) on the camel site. 
http://activemq.apache.org/camel/ 


I think what is needed is a wiki page about the thread DSL and what it can be used for. And with links to relevant pages such as some of the ones above.



Med venlig hilsen
 
Claus Ibsen
......................................
Silverbullet
Skovsgårdsvænget 21
8362 Hørning
Tlf. +45 2962 7576
Web: www.silverbullet.dk
-----Original Message-----
From: huntc [mailto:huntc@mac.com] 
Sent: 27. oktober 2008 21:10
To: camel-user@activemq.apache.org
Subject: RE: activemq endpoint and thread pools


Hi Claus,

Thank you for pointing out that I needed the "concurrentConsumers" parameter
to my endpoint URI - that's a little hidden I must say(!). As a relative
newcomer I would have thought that the "thread" method be the thing to use.

Would it be a useful enhancement to have the thread method set the
concurrentConsumers property where the endpoint is derived from jms, or does
that pollute the code?

Kind regards,
Christopher
-- 
View this message in context: http://www.nabble.com/activemq-endpoint-and-thread-pools-tp20187089s22882p20195390.html
Sent from the Camel - Users mailing list archive at Nabble.com.


RE: activemq endpoint and thread pools

Posted by Claus Ibsen <ci...@silverbullet.dk>.
Hi

There is a FAQ entry also, but I guess it is a bit hard to find this gem as it's the consumer that is responsible for concurrency, and not the thread pool.

http://activemq.apache.org/camel/why-does-my-jms-route-only-consume-one-message-at-once.html

Also the jms component has some documentation how to configure concurrency:
http://activemq.apache.org/camel/jms.html 

And some notes about concurrency here:
http://activemq.apache.org/camel/parallel-processing-and-ordering.html

A good tip is to use the search inputbox (menu to the right) on the camel site. 
http://activemq.apache.org/camel/ 


I think what is needed is a wiki page about the thread DSL and what it can be used for. And with links to relevant pages such as some of the ones above.



Med venlig hilsen
 
Claus Ibsen
......................................
Silverbullet
Skovsgårdsvænget 21
8362 Hørning
Tlf. +45 2962 7576
Web: www.silverbullet.dk
-----Original Message-----
From: huntc [mailto:huntc@mac.com] 
Sent: 27. oktober 2008 21:10
To: camel-user@activemq.apache.org
Subject: RE: activemq endpoint and thread pools


Hi Claus,

Thank you for pointing out that I needed the "concurrentConsumers" parameter
to my endpoint URI - that's a little hidden I must say(!). As a relative
newcomer I would have thought that the "thread" method be the thing to use.

Would it be a useful enhancement to have the thread method set the
concurrentConsumers property where the endpoint is derived from jms, or does
that pollute the code?

Kind regards,
Christopher
-- 
View this message in context: http://www.nabble.com/activemq-endpoint-and-thread-pools-tp20187089s22882p20195390.html
Sent from the Camel - Users mailing list archive at Nabble.com.


RE: activemq endpoint and thread pools

Posted by huntc <hu...@mac.com>.
Hi Claus,

Thank you for pointing out that I needed the "concurrentConsumers" parameter
to my endpoint URI - that's a little hidden I must say(!). As a relative
newcomer I would have thought that the "thread" method be the thing to use.

Would it be a useful enhancement to have the thread method set the
concurrentConsumers property where the endpoint is derived from jms, or does
that pollute the code?

Kind regards,
Christopher
-- 
View this message in context: http://www.nabble.com/activemq-endpoint-and-thread-pools-tp20187089s22882p20195390.html
Sent from the Camel - Users mailing list archive at Nabble.com.


RE: activemq endpoint and thread pools

Posted by Claus Ibsen <ci...@silverbullet.dk>.
Hi

See this thread:
http://www.nabble.com/Bean-properties%3A-concurrentConsumers-problem-tt20113967s22882.html


Med venlig hilsen
 
Claus Ibsen
......................................
Silverbullet
Skovsgårdsvænget 21
8362 Hørning
Tlf. +45 2962 7576
Web: www.silverbullet.dk

-----Original Message-----
From: huntc [mailto:huntc@mac.com] 
Sent: 27. oktober 2008 13:53
To: camel-user@activemq.apache.org
Subject: activemq endpoint and thread pools


Hi there,

If I do something like this:


from("activemq:queue:myqueue").thread(2).process(new Processor() {
	public void process(Exchange exchange) throws Exception {
		Thread.sleep(1000);
	}
})...do something else


...then should that mean that I can have two processors processing messages
concurrently?

I ask because it appears that only one thread is being used.

I'm using Camel 1.4. Thanks for any clarification.

Kind regards,
Christopher
-- 
View this message in context: http://www.nabble.com/activemq-endpoint-and-thread-pools-tp20187089s22882p20187089.html
Sent from the Camel - Users mailing list archive at Nabble.com.