|
RSS Feed - WebSphere MQ Support
|
RSS Feed - Message Broker Support
|
 |
|
MQSeries Design Question |
« View previous topic :: View next topic » |
Author |
Message
|
kairaja |
Posted: Sat Feb 09, 2002 4:01 pm Post subject: |
|
|
Novice
Joined: 08 Feb 2002 Posts: 13
|
I have a JSP page which would want to place messages on a QMGr on the Application Server box. I wrote a Java Class, MQ.java that takes number of connections as parameter. What it is doing is it calls
connection = new MQQueueManager("QMGR"); for number of connections parameter times and stores then in a hashtable.
JSP page initiates the MQ class and puts in application scope. When user presses a key on JSP page, it will consult the MQ class and grabs the connection from the hashtable. It then uses it to do MQPut call. In this way i am pooling the connection to MQ.
Now is anything wrong with this approach ?
Then it will |
|
Back to top |
|
 |
kolban |
Posted: Sat Feb 09, 2002 7:56 pm Post subject: |
|
|
 Grand Master
Joined: 22 May 2001 Posts: 1072 Location: Fort Worth, TX, USA
|
Sounds perfect to me. You have basically implemented your own connection pooling technology. Be aware that MQ provides some assistance for this... see the connection pooling section of the MQ Using Java manual. |
|
Back to top |
|
 |
PeterPotkay |
Posted: Mon Feb 11, 2002 5:27 am Post subject: |
|
|
 Poobah
Joined: 15 May 2001 Posts: 7722
|
Kolban,
I feel dumb asking this, but can you explain connection pooling please? I keep seeing this term more and more in posts dealing with JAVA and want to make sure I understand it correctly. (For instance, is it only applicable to JAVA?)
_________________ Peter Potkay
Keep Calm and MQ On |
|
Back to top |
|
 |
mpuetz |
Posted: Tue Feb 12, 2002 4:05 pm Post subject: |
|
|
Centurion
Joined: 05 Jul 2001 Posts: 149 Location: IBM/Central WebSphere Services
|
Hi,
the concept of a pool of resources is pretty common
in scalable, multi-threaded applications (not just in Java)
Making connections (to e.g. databases,MQ or other servers)
is usually expensive, so want to do that once at startup
and keep them open until the app ends.
If you have multiple threads they would ask the pool coordinator
to give them an unused connection for temporary use. When
they are done they release it to the pool for other threads
to use, but they are never closed until the app shuts down.
_________________ Mathias Puetz
IBM/Central WebSphere Services
WebSphere Business Integration Specialist |
|
Back to top |
|
 |
|
|
 |
|
Page 1 of 1 |
|
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum
|
|
|
|