You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@camel.apache.org by makkenza <mu...@gmail.com> on 2017/03/24 11:49:21 UTC

Process several messages from several JMSEndpoints with single ThreadPool

We have a GUI app that creates a queue for every product to communicate with
the server. As a result for every queue, Camel creates 3 threads
(JmsConsumer, JmsReplyManagerTimoutChecker, and TemporaryQueueReplyManager)
so after user adds 200+ products on his GUI, number of threads hits 2K and
OSX won't allow creating more threads per process and JVM throws OOMError,
with "can't create more native threads" message.

In order to solve this problem (without making much code changes), I would
like to use a single ThreadPool that would process work of above 3
threads/product...

*So far I've tried: 
JmsConfiguration myJmsConfiguration = new
JmsConfiguration(aConnectionFactory);
myJmsConfiguration.setTaskExecutor(theTaskExecutor);
myJmsConfiguration.setDefaultTaskExecutorType(DefaultTaskExecutorType.ThreadPool);
return JmsComponent.jmsComponent(myJmsConfiguration);
*
However, above does not work well, with sporadic errors like : 
org.apache.camel.RuntimeExchangeException: Failed to resolve replyTo
destination on the exchange: Exchange[Message: BLAH]

Was wondering if anyone has done something like that before?




--
View this message in context: http://camel.465427.n5.nabble.com/Process-several-messages-from-several-JMSEndpoints-with-single-ThreadPool-tp5796093.html
Sent from the Camel - Users mailing list archive at Nabble.com.

Re: Process several messages from several JMSEndpoints with single ThreadPool

Posted by makkenza <mu...@gmail.com>.
Yes.



--
View this message in context: http://camel.465427.n5.nabble.com/Process-several-messages-from-several-JMSEndpoints-with-single-ThreadPool-tp5796093p5796265.html
Sent from the Camel - Users mailing list archive at Nabble.com.

Re: Process several messages from several JMSEndpoints with single ThreadPool

Posted by souciance <so...@gmail.com>.
Are you using ActiveMQ as your provider?

On Mon, Mar 27, 2017 at 9:57 AM, makkenza [via Camel] <
ml-node+s465427n5796247h20@n5.nabble.com> wrote:

> The GUI might get updates to the product from the customers, therefore, we
> want to keep the queues as long as the GUI is running. Users have Alerts
> setup on their GUI, so when customers send updates, those Alerts might
> trigger...
>
> ------------------------------
> If you reply to this email, your message will be added to the discussion
> below:
> http://camel.465427.n5.nabble.com/Process-several-messages-
> from-several-JMSEndpoints-with-single-ThreadPool-tp5796093p5796247.html
> To start a new topic under Camel - Users (activemq), email
> ml-node+s465427n465429h62@n5.nabble.com
> To unsubscribe from Camel - Users, click here
> <http://camel.465427.n5.nabble.com/template/NamlServlet.jtp?macro=unsubscribe_by_code&node=465428&code=c291Y2lhbmNlLmVxZGFtLnJhc2h0aUBnbWFpbC5jb218NDY1NDI4fDE1MzI5MTE2NTY=>
> .
> NAML
> <http://camel.465427.n5.nabble.com/template/NamlServlet.jtp?macro=macro_viewer&id=instant_html%21nabble%3Aemail.naml&base=nabble.naml.namespaces.BasicNamespace-nabble.view.web.template.NabbleNamespace-nabble.view.web.template.NodeNamespace&breadcrumbs=notify_subscribers%21nabble%3Aemail.naml-instant_emails%21nabble%3Aemail.naml-send_instant_email%21nabble%3Aemail.naml>
>




--
View this message in context: http://camel.465427.n5.nabble.com/Process-several-messages-from-several-JMSEndpoints-with-single-ThreadPool-tp5796093p5796248.html
Sent from the Camel - Users mailing list archive at Nabble.com.

Re: Process several messages from several JMSEndpoints with single ThreadPool

Posted by makkenza <mu...@gmail.com>.
The GUI might get updates to the product from the customers, therefore, we
want to keep the queues as long as the GUI is running. Users have Alerts
setup on their GUI, so when customers send updates, those Alerts might
trigger...



--
View this message in context: http://camel.465427.n5.nabble.com/Process-several-messages-from-several-JMSEndpoints-with-single-ThreadPool-tp5796093p5796247.html
Sent from the Camel - Users mailing list archive at Nabble.com.

Re: Process several messages from several JMSEndpoints with single ThreadPool

Posted by souciance <so...@gmail.com>.
The reason I ask is that, shouldn't the queues be temporarily created and
once the processing is over, they are then destroyed?

On Mon, Mar 27, 2017 at 9:16 AM, makkenza [via Camel] <
ml-node+s465427n5796223h76@n5.nabble.com> wrote:

> They usually start with 50 then during the day, as users need to work on
> more products, they add more. Mid-day they end up with OOM error when they
> hit 180 - 200 products.
>
> ------------------------------
> If you reply to this email, your message will be added to the discussion
> below:
> http://camel.465427.n5.nabble.com/Process-several-messages-
> from-several-JMSEndpoints-with-single-ThreadPool-tp5796093p5796223.html
> To start a new topic under Camel - Users (activemq), email
> ml-node+s465427n465429h62@n5.nabble.com
> To unsubscribe from Camel - Users, click here
> <http://camel.465427.n5.nabble.com/template/NamlServlet.jtp?macro=unsubscribe_by_code&node=465428&code=c291Y2lhbmNlLmVxZGFtLnJhc2h0aUBnbWFpbC5jb218NDY1NDI4fDE1MzI5MTE2NTY=>
> .
> NAML
> <http://camel.465427.n5.nabble.com/template/NamlServlet.jtp?macro=macro_viewer&id=instant_html%21nabble%3Aemail.naml&base=nabble.naml.namespaces.BasicNamespace-nabble.view.web.template.NabbleNamespace-nabble.view.web.template.NodeNamespace&breadcrumbs=notify_subscribers%21nabble%3Aemail.naml-instant_emails%21nabble%3Aemail.naml-send_instant_email%21nabble%3Aemail.naml>
>




--
View this message in context: http://camel.465427.n5.nabble.com/Process-several-messages-from-several-JMSEndpoints-with-single-ThreadPool-tp5796093p5796224.html
Sent from the Camel - Users mailing list archive at Nabble.com.

Re: Process several messages from several JMSEndpoints with single ThreadPool

Posted by makkenza <mu...@gmail.com>.
They usually start with 50 then during the day, as users need to work on more
products, they add more. Mid-day they end up with OOM error when they hit
180 - 200 products.



--
View this message in context: http://camel.465427.n5.nabble.com/Process-several-messages-from-several-JMSEndpoints-with-single-ThreadPool-tp5796093p5796223.html
Sent from the Camel - Users mailing list archive at Nabble.com.

Re: Process several messages from several JMSEndpoints with single ThreadPool

Posted by souciance <so...@gmail.com>.
Are those 200 products created in parallel or quick succession?

Den 24 mars 2017 12:49 em skrev "makkenza [via Camel]" <
ml-node+s465427n5796093h46@n5.nabble.com>:

> We have a GUI app that creates a queue for every product to communicate
> with the server. As a result for every queue, Camel creates 3 threads
> (JmsConsumer, JmsReplyManagerTimoutChecker, and TemporaryQueueReplyManager)
> so after user adds 200+ products on his GUI, number of threads hits 2K and
> OSX won't allow creating more threads per process and JVM throws OOMError,
> with "can't create more native threads" message.
>
> In order to solve this problem (without making much code changes), I would
> like to use a single ThreadPool that would process work of above 3
> threads/product...
>
>
>
>
>
>
> *So far I've tried: JmsConfiguration myJmsConfiguration = new
> JmsConfiguration(aConnectionFactory);
> myJmsConfiguration.setTaskExecutor(theTaskExecutor);
> myJmsConfiguration.setDefaultTaskExecutorType(DefaultTaskExecutorType.ThreadPool);
> return JmsComponent.jmsComponent(myJmsConfiguration); *
> However, above does not work well, with sporadic errors like :
> org.apache.camel.RuntimeExchangeException: Failed to resolve replyTo
> destination on the exchange: Exchange[Message: BLAH]
>
> Was wondering if anyone has done something like that before?
>
>
> ------------------------------
> If you reply to this email, your message will be added to the discussion
> below:
> http://camel.465427.n5.nabble.com/Process-several-messages-
> from-several-JMSEndpoints-with-single-ThreadPool-tp5796093.html
> To start a new topic under Camel - Users (activemq), email
> ml-node+s465427n465429h62@n5.nabble.com
> To unsubscribe from Camel - Users, click here
> <http://camel.465427.n5.nabble.com/template/NamlServlet.jtp?macro=unsubscribe_by_code&node=465428&code=c291Y2lhbmNlLmVxZGFtLnJhc2h0aUBnbWFpbC5jb218NDY1NDI4fDE1MzI5MTE2NTY=>
> .
> NAML
> <http://camel.465427.n5.nabble.com/template/NamlServlet.jtp?macro=macro_viewer&id=instant_html%21nabble%3Aemail.naml&base=nabble.naml.namespaces.BasicNamespace-nabble.view.web.template.NabbleNamespace-nabble.view.web.template.NodeNamespace&breadcrumbs=notify_subscribers%21nabble%3Aemail.naml-instant_emails%21nabble%3Aemail.naml-send_instant_email%21nabble%3Aemail.naml>
>




--
View this message in context: http://camel.465427.n5.nabble.com/Process-several-messages-from-several-JMSEndpoints-with-single-ThreadPool-tp5796093p5796221.html
Sent from the Camel - Users mailing list archive at Nabble.com.