Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

sample code for cluster

Status
Not open for further replies.

lecmns

Programmer
Sep 11, 2001
19
IN
fOlks..

I am trying to do is write a program (in Java) that will do put / get operation on a clustered queue. I don't know who this has to be done..

I searched the net quiet a bit, but found nothing helpful so far to start something on coding..

Can anybody help me with some sample code to do these operations on a clustered queue?
And another thing is about the Exit programs, where and why should anyone use them, I am confused..

help me guys.. Thankx in advance..

MNS
lecMns
B'lore
 
Well I'm not a Java programmer, I use COBOL, but the concepts are the same. You dont need to code anything special on a MQGET or MQPUT to use a clustered queue. The clustered queue manager configuration will take care of the message itself.

You can, however, specify options on the MQOPEN command to make sure that a specific queue is PUT to if there are multiple queues of the same name in existence within a cluster.

Otherwise code your MQGET and MQPUT the same.

Jim

 
but I am using MQ JMS and I think there's some difference in putting message to a simple queue and a clustered queue because in a normal case, we need to mention the QueueManager name and Queue but in the clustered queue, we say the cluster name and queue only, right? this is just a doubt. I don't know if this is applicable only to the latest version ie/. 5.2 on Windows..

One scenario I have in confusion is the following situation.

I have two QueueManagers QM1 and QM2. I have a local queue Q1 in QM1 which I have made shared to the cluster. Now, I'll see the copy of Q1 in QM2 also.. Now, is the problem. I will eb able to put message to Q1 from QM1 or QM2. But I can read message of Q1 only from QM1 and not from QM2.
Is there some way of doing that? I can now put listener only on Q1 in QM1 and not on QM2. what if QM1 goes down..? everything's gone? I don't want that to happen. Do we have a solution for this? We should be having, right?

Another prob is whe ni put a message into a queue, I start a listener on the same queue to get the response. In a clustered queue, where and on which queue will I start this listener? How can we predict this?

I have heard that in all Queue Managers I can may be create local queues with the same name and then have listeners on all QueueManagers, message put to that queue name wil come to one of these local queues and then it can be processed by listener on that lcoal queue. I did try this, but didn't seem working. May be I went wrong somewhere, I'll hav to try that again.. folks, any idea.. ?

please help me out..
I am nearing my deadline.. :(

MNS
lecMns
B'lore
 


Hello,


Try setting the ReplyToQueue and ReplyToQueueManager in the MQMD of your request. This will tell the MQ components where (not how) to route the response.




-timmo
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top