You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@activemq.apache.org by moismail <mo...@gmail.com> on 2011/08/21 15:20:48 UTC

Sharing producer session between threads

Hi, 

I have a multi-threaded application that sends millions of messages
continuously. If I set the number of threads to greater than 8 I get the
exception OutOfMemory or the exception too many open files. Tweaking the OS
limits and memory has helped but still activemq hangs. So I thought that I
need to share either the connection or the session object. What is the best
practice to do this? Is there an example for it? 

Thanks

--
View this message in context: http://activemq.2283324.n4.nabble.com/Sharing-producer-session-between-threads-tp3758384p3758384.html
Sent from the ActiveMQ - User mailing list archive at Nabble.com.

Re: Sharing producer session between threads

Posted by Gary Tully <ga...@gmail.com>.
yep: http://activemq.apache.org/maven/5.4.0/activemq-pool/apidocs/index.html

On 22 August 2011 12:32, moismail <mo...@gmail.com> wrote:
> Hi Gary,
>
> Thanks for the reply but, v 5.5 has a dependency on JDK 1.6 and I am using
> JDK 1.5 right now. Is its supported under version 5.4.2 ?
>
> Thanks
>
> On Mon, Aug 22, 2011 at 1:39 PM, Gary Tully [via ActiveMQ] <
> ml-node+3759736-240455935-261398@n4.nabble.com> wrote:
>
>> use a connection pool, see:
>> http://activemq.apache.org/maven/5.5.0/activemq-pool/apidocs/index.html
>>
>> On 21 August 2011 15:38, moismail <[hidden email]<http://user/SendEmail.jtp?type=node&node=3759736&i=0>>
>> wrote:
>>
>> > Hi All,
>> >
>> > I am trying to send huge amount of messages from multiple threads. I want
>> to
>> > optimize the performance by sharing either the session or the connection
>> > object. What is the best practice for it? What about the thread safety?
>> >
>> > Thanks
>> >
>> > --
>> > View this message in context:
>> http://activemq.2283324.n4.nabble.com/Sharing-producer-session-between-threads-tp3758499p3758499.html
>> > Sent from the ActiveMQ - User mailing list archive at Nabble.com.
>> >
>>
>>
>>
>> --
>> http://fusesource.com
>> http://blog.garytully.com
>>
>>
>> ------------------------------
>>  If you reply to this email, your message will be added to the discussion
>> below:
>>
>> http://activemq.2283324.n4.nabble.com/Sharing-producer-session-between-threads-tp3758384p3759736.html
>>  To unsubscribe from Sharing producer session between threads, click here<http://activemq.2283324.n4.nabble.com/template/NamlServlet.jtp?macro=unsubscribe_by_code&node=3758384&code=bW9oYW1tZWQuaGFueUBnbWFpbC5jb218Mzc1ODM4NHwyMDcyOTc4NjQz>.
>>
>>
>
>
> --
> View this message in context: http://activemq.2283324.n4.nabble.com/Sharing-producer-session-between-threads-tp3758384p3759823.html
> Sent from the ActiveMQ - User mailing list archive at Nabble.com.



-- 
http://fusesource.com
http://blog.garytully.com

Re: Sharing producer session between threads

Posted by moismail <mo...@gmail.com>.
Hi Gary,

Thanks for the reply but, v 5.5 has a dependency on JDK 1.6 and I am using
JDK 1.5 right now. Is its supported under version 5.4.2 ?

Thanks

On Mon, Aug 22, 2011 at 1:39 PM, Gary Tully [via ActiveMQ] <
ml-node+3759736-240455935-261398@n4.nabble.com> wrote:

> use a connection pool, see:
> http://activemq.apache.org/maven/5.5.0/activemq-pool/apidocs/index.html
>
> On 21 August 2011 15:38, moismail <[hidden email]<http://user/SendEmail.jtp?type=node&node=3759736&i=0>>
> wrote:
>
> > Hi All,
> >
> > I am trying to send huge amount of messages from multiple threads. I want
> to
> > optimize the performance by sharing either the session or the connection
> > object. What is the best practice for it? What about the thread safety?
> >
> > Thanks
> >
> > --
> > View this message in context:
> http://activemq.2283324.n4.nabble.com/Sharing-producer-session-between-threads-tp3758499p3758499.html
> > Sent from the ActiveMQ - User mailing list archive at Nabble.com.
> >
>
>
>
> --
> http://fusesource.com
> http://blog.garytully.com
>
>
> ------------------------------
>  If you reply to this email, your message will be added to the discussion
> below:
>
> http://activemq.2283324.n4.nabble.com/Sharing-producer-session-between-threads-tp3758384p3759736.html
>  To unsubscribe from Sharing producer session between threads, click here<http://activemq.2283324.n4.nabble.com/template/NamlServlet.jtp?macro=unsubscribe_by_code&node=3758384&code=bW9oYW1tZWQuaGFueUBnbWFpbC5jb218Mzc1ODM4NHwyMDcyOTc4NjQz>.
>
>


--
View this message in context: http://activemq.2283324.n4.nabble.com/Sharing-producer-session-between-threads-tp3758384p3759823.html
Sent from the ActiveMQ - User mailing list archive at Nabble.com.