You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@camel.apache.org by Dayakar <da...@gmail.com> on 2013/10/29 12:10:35 UTC

Is it better to use PooledConnectionFactory in Parallel Processing

Hi,

Previously we are using ActiveMQConnectionFactory alone, and we observed
that while starting the JBoss Server ActiveMQ is creating multiple threads
and closing (ActiveMQ Task 1, ActiveMQ Task 2, ...), we thought it creating
multiple connections/session are creating and closing.

As a resolution, we want to use PooledConnectionFactory

1) We are using Camel Routes to prepare and send messages to destination, we
invoke 7 routes and each route configured with parallel processing (Min
value is 5 and max value is 25 threads), daily we process around 3 Lakh
Messages (= 300.000) and All Routes are TRANSACTED.

In Parallel Processing Is it better to use PooledConnectionFactory?

For Each Message PooledConnectionFactory create one session (or) Session
object will be shared by Multiple messages?





--
View this message in context: http://camel.465427.n5.nabble.com/Is-it-better-to-use-PooledConnectionFactory-in-Parallel-Processing-tp5742350.html
Sent from the Camel - Users mailing list archive at Nabble.com.

Re: Is it better to use PooledConnectionFactory in Parallel Processing

Posted by Claus Ibsen <cl...@gmail.com>.
Its always a good idea to use pooled connection factory with a JMS
broker. It improves performance and avoids creating and stopping
connections all the time which eats up resources as well.

Also reusing sessions/consumers can speedup as well, there is the
cacheLevelName option on the JMS component to configure this.

Take a look at
http://camel.apache.org/jms

And pay attention to that transacted and cacheLevelName.

And if you do request/reply over JMS then there is also some options
about what kind of replyToType you are using.

And for ActiveMQ there is a sample about using its connection pool at
http://activemq.apache.org/

And spring framework also has a connection pool out of the box you can
use. See the spring docs about that one.

On Tue, Oct 29, 2013 at 12:10 PM, Dayakar <da...@gmail.com> wrote:
> Hi,
>
> Previously we are using ActiveMQConnectionFactory alone, and we observed
> that while starting the JBoss Server ActiveMQ is creating multiple threads
> and closing (ActiveMQ Task 1, ActiveMQ Task 2, ...), we thought it creating
> multiple connections/session are creating and closing.
>
> As a resolution, we want to use PooledConnectionFactory
>
> 1) We are using Camel Routes to prepare and send messages to destination, we
> invoke 7 routes and each route configured with parallel processing (Min
> value is 5 and max value is 25 threads), daily we process around 3 Lakh
> Messages (= 300.000) and All Routes are TRANSACTED.
>
> In Parallel Processing Is it better to use PooledConnectionFactory?
>
> For Each Message PooledConnectionFactory create one session (or) Session
> object will be shared by Multiple messages?
>
>
>
>
>
> --
> View this message in context: http://camel.465427.n5.nabble.com/Is-it-better-to-use-PooledConnectionFactory-in-Parallel-Processing-tp5742350.html
> Sent from the Camel - Users mailing list archive at Nabble.com.



-- 
Claus Ibsen
-----------------
Red Hat, Inc.
Email: cibsen@redhat.com
Twitter: davsclaus
Blog: http://davsclaus.com
Author of Camel in Action: http://www.manning.com/ibsen

Re: Is it better to use PooledConnectionFactory in Parallel Processing

Posted by Christian Müller <ch...@gmail.com>.
In general, you should use the PooledConnectionFactory. The connections are
created upfront which saves time. The connections are also reused which is
more resource friendly.

Best,

Christian
-----------------

Software Integration Specialist

Apache Member
V.P. Apache Camel | Apache Camel PMC Member | Apache Camel committer
Apache Incubator PMC Member

https://www.linkedin.com/pub/christian-mueller/11/551/642


On Tue, Oct 29, 2013 at 12:10 PM, Dayakar <da...@gmail.com> wrote:

> Hi,
>
> Previously we are using ActiveMQConnectionFactory alone, and we observed
> that while starting the JBoss Server ActiveMQ is creating multiple threads
> and closing (ActiveMQ Task 1, ActiveMQ Task 2, ...), we thought it creating
> multiple connections/session are creating and closing.
>
> As a resolution, we want to use PooledConnectionFactory
>
> 1) We are using Camel Routes to prepare and send messages to destination,
> we
> invoke 7 routes and each route configured with parallel processing (Min
> value is 5 and max value is 25 threads), daily we process around 3 Lakh
> Messages (= 300.000) and All Routes are TRANSACTED.
>
> In Parallel Processing Is it better to use PooledConnectionFactory?
>
> For Each Message PooledConnectionFactory create one session (or) Session
> object will be shared by Multiple messages?
>
>
>
>
>
> --
> View this message in context:
> http://camel.465427.n5.nabble.com/Is-it-better-to-use-PooledConnectionFactory-in-Parallel-Processing-tp5742350.html
> Sent from the Camel - Users mailing list archive at Nabble.com.
>