Author |
Message
|
mq_tyro |
Posted: Sun Feb 01, 2004 3:34 pm Post subject: Pooling connection to Queues |
|
|
Novice
Joined: 10 Jul 2002 Posts: 19 Location: Mumbai
|
Hi,
In out application we are using MQ Java Client to connect to Q-Manager.
We were wondering if we can create a pool of conections to Queue of the Q-Maager.
Meaning the pool woud be a collection of "MQQueue" java objects.
Using any of these java objects can we put the message in the queue ?
Thanks a lot. _________________ IBM Certified MQSeries Specialist |
|
Back to top |
|
 |
saju |
Posted: Mon Feb 02, 2004 11:39 am Post subject: Re: Pooling connection to Queues |
|
|
 Newbie
Joined: 02 Feb 2004 Posts: 9 Location: India
|
Yes!
It will work. You can put message to a queue using the connection pool (Queue manager object). Only thing to be noted is to get connected to the queue each time before you try putting message to it. Also do this entire operation in a "try - catch" block.
It really works for my application.
- Saju _________________ Dreams get you into the future and add excitement to the present... |
|
Back to top |
|
 |
mq_tyro |
Posted: Mon Feb 02, 2004 10:41 pm Post subject: |
|
|
Novice
Joined: 10 Jul 2002 Posts: 19 Location: Mumbai
|
Hi Saju,
Thanks for the informatoion.
I was wondering if the we can pool the connection handles to the Queue and not the Q-Managers. That way everytime I put a message in a Queue, I can use the same connection handle to queue.
Please let me know
Thanks a lot. _________________ IBM Certified MQSeries Specialist |
|
Back to top |
|
 |
saju |
Posted: Tue Feb 03, 2004 1:02 am Post subject: |
|
|
 Newbie
Joined: 02 Feb 2004 Posts: 9 Location: India
|
If you are using Java, you can perhaps store the connection objects in a HashMap or Arraylist. When you want to put the message to a queue belonging to a queue manager, establish connection with that queue using the Connection object of the Queue manager of that queue. Then put the message and close the queue.
Step 1: Store Queue manager connection objects in a HashMap or ArrayList.
Step 2: Using the connection object of Queue manager, get connected to the queue.
Step 3: Put / Get message to/from the queue.
Step 4: Close connectiong to the queue.
This is working for my application...so you can also get your desired result.
- Saju _________________ Dreams get you into the future and add excitement to the present... |
|
Back to top |
|
 |
mq_tyro |
Posted: Tue Feb 03, 2004 9:16 am Post subject: |
|
|
Novice
Joined: 10 Jul 2002 Posts: 19 Location: Mumbai
|
Thanks buddy.
Appriciate your help. _________________ IBM Certified MQSeries Specialist |
|
Back to top |
|
 |
|