In JMS we have the Connection object that establishes the TCP/IP connection between the JMS Client machine and the JMS Provider. We have session object to create the senders - receivers and publishers - subscribers depending on if we are implementing p2p or publish - subscribe message paradigm.
Its said that from 1 connection object multiple session objects can be created but am not getting the whole point of having multiple sessions and what was the reason why we have two different objects Connection and Session if the Connection object could provide the services as provided by Session ?
please answer.
-
JMS - Connection & Session (2 messages)
- Posted by: Kavita Mundada
- Posted on: March 09 2006 23:22 EST
Threaded Messages (2)
- JMS - Connection & Session by James Strachan on March 20 2006 23:20 EST
- JMS - Connection & Session by James Strachan on March 20 2006 23:21 EST
-
JMS - Connection & Session[ Go to top ]
- Posted by: James Strachan
- Posted on: March 20 2006 23:20 EST
- in response to Kavita Mundada
Its to do with threading and consumption.
If you are using async consumption of messages, the contract is each session will only dispatch in one thread at once. So if you want to consume in 20 threads concurrently using the JMS client API, create 20 sessions.
(You get much more fine control over things like concurrency, threading, pooling and transactions using JCA)
James
LogicBlaze
Open Source SOA -
JMS - Connection & Session[ Go to top ]
- Posted by: James Strachan
- Posted on: March 20 2006 23:21 EST
- in response to James Strachan
BTW transactions also happen at the Session level (not the connection level as many threads may be working on different transactions using the same connection)
James
LogicBlaze
Open Source SOA