-
1. Re: Client Session concurrent usage in 2.4.1.Final
ataylor Apr 28, 2014 5:29 AM (in response to yairogen)no they are not thread safe, tret them the same way you would use JMS sessions etc.
By re use we mean that you should not create a new one every time you need to send/receive a message etc.
-
2. Re: Client Session concurrent usage in 2.4.1.Final
yairogen Apr 28, 2014 5:44 AM (in response to ataylor)So basically, I have to create a session+consumer+producer trio on a thread local to verify they are single threaded. correct?
-
3. Re: Client Session concurrent usage in 2.4.1.Final
ataylor Apr 28, 2014 5:57 AM (in response to yairogen)well that's an architectural choice for your application, just make sure you dont have the same thread accessing the same session at any one time.
-
4. Re: Client Session concurrent usage in 2.4.1.Final
yairogen Apr 28, 2014 6:01 AM (in response to ataylor)I am sure it is a common problem? Is having hundreds or more instances of sessions, producers and consumers in a single process considered to be ok?
-
5. Re: Client Session concurrent usage in 2.4.1.Final
ataylor Apr 28, 2014 6:12 AM (in response to yairogen)sessions are heavy weight objects so if you can use a single session with multiple producers/consumers then do that, if you are trying to maximize throughput then remember that if you create many sessions from the same connection factory then they will use the same underlying connection so you wouldnt see much advantage. as to how many connections/sessions you can create well this is dependent on your underlying resources, memory,sockets etc etc
-
6. Re: Client Session concurrent usage in 2.4.1.Final
yairogen Apr 28, 2014 8:13 AM (in response to ataylor)Assume I;m running in a Http Container. I am running with multiple threads by design. So - if my http server is configured with 4000 threads, I will probably hold 5000 sessions (from the same connection factory).
Will this affect my application by Memory consumption only or in other ways as well?
-
7. Re: Client Session concurrent usage in 2.4.1.Final
ataylor Apr 28, 2014 8:54 AM (in response to yairogen)Assume I;m running in a Http Container. I am running with multiple threads by design. So - if my http server is configured with 4000 threads, I will probably hold 5000 sessions (from the same connection factory).
This is why Application Servers have connection pooling provided by JCA. you would need to add something similar. you probably need to provide something similar.
Will this affect my application by Memory consumption only or in other ways as well?
if its only 1 connection you are using then probably not altho there may be contention on the wire, if you are creating 5000 connections then these will have sockets open.