Author |
Message
|
ydsk |
Posted: Mon Aug 28, 2006 8:09 pm Post subject: accessQueue method - a basic question |
|
|
Chevalier
Joined: 23 May 2005 Posts: 410
|
The definition of accessQueue method in Java MQ API says:
accessQueue(String queueName, int openOptions,String queueManagerName,String dynamicQueueName,String alternateUserId)
But we actually call the method this way:
qMgr.accessQueue(..,...,.) ;
So, what do the qMgr object and the queueManagerName parameter refer to ? Are they both the same ? Or can they be 2 different queue managers ?
Can some expert please clarify giving some details
Thanks for your time.
ydsk. |
|
Back to top |
|
 |
ydsk |
Posted: Tue Aug 29, 2006 7:15 am Post subject: |
|
|
Chevalier
Joined: 23 May 2005 Posts: 410
|
Can someone pls help me with my question above.
Thanks in advance.
ydsk. |
|
Back to top |
|
 |
jefflowrey |
Posted: Tue Aug 29, 2006 10:44 am Post subject: |
|
|
Grand Poobah
Joined: 16 Oct 2002 Posts: 19981
|
Where have you looked for this information?
What do you think these parameters refer to?
What happens when you try putting different values in for these parameters?
What did the person who told you to use the parameters you use, say when you asked them about these other parameters? _________________ I am *not* the model of the modern major general. |
|
Back to top |
|
 |
ydsk |
Posted: Tue Aug 29, 2006 11:11 am Post subject: |
|
|
Chevalier
Joined: 23 May 2005 Posts: 410
|
I was looking at the syntax of the function in Using java manual. Nobody gave me any code or asked me to do anything. Looking at the syntax I got curious and posted the question.
I think we can specify a different qmgr name as parameter to accessQueue method than the qmgr we object with which we are calling the method. For example when we want a java program to connect to qmgr A and PUT a msg onto a queue physically defined on qmgr B ( of course, both A and B should be connected with SDR-RCVR channel pairs).
Is my thinking correct ?
[/u][/i] |
|
Back to top |
|
 |
wschutz |
Posted: Tue Aug 29, 2006 11:20 am Post subject: |
|
|
 Jedi Knight
Joined: 02 Jun 2005 Posts: 3316 Location: IBM (retired)
|
To *really* understand what THAT qmgr means, you have have an understanding of how distributed queueing works.... I suggest reading one of the "Intro to MQ" redbooks previously reference here.... _________________ -wayne |
|
Back to top |
|
 |
ydsk |
Posted: Tue Aug 29, 2006 1:39 pm Post subject: |
|
|
Chevalier
Joined: 23 May 2005 Posts: 410
|
Wayne,
I understand distributed queueing well. I was an MQ admin for a little more than a year.
I am new to java programming with MQ.
Now can someone pls tell me if my understanding is correct ?
Thanks.
ydsk. |
|
Back to top |
|
 |
saketr |
Posted: Tue Aug 29, 2006 1:44 pm Post subject: |
|
|
Apprentice
Joined: 08 Feb 2006 Posts: 41
|
Some thoughts based on .NET syntax (very similar to Java):
Assuming that you have QM1 and QM2, with local queue 'a' on QM1 and local queue 'b' on QM2 and that you are connected to QM1 initially (i.e., in
example below myQueueManager refers to QM1), then:
To access queue 'a', try:
MQQueue q = myQueueManager.AccessQueue("a", myOpenOptions);
To access queue 'b', try:
MQQueue q = myQueueManager.AccessQueue("b", myOpenOptions, "QM2", null, null);
all assuming that QM1 and QM2 are connected together appropiately (using channels).
Warm regards,
Saket |
|
Back to top |
|
 |
jefflowrey |
Posted: Tue Aug 29, 2006 2:00 pm Post subject: |
|
|
Grand Poobah
Joined: 16 Oct 2002 Posts: 19981
|
jefflowrey wrote: |
What happens when you try putting different values in for these parameters? |
Why wait for us to tell you something, when you can find out for yourself? _________________ I am *not* the model of the modern major general. |
|
Back to top |
|
 |
ydsk |
Posted: Tue Aug 29, 2006 2:29 pm Post subject: |
|
|
Chevalier
Joined: 23 May 2005 Posts: 410
|
Now the real question:
Why don't we have a similar feature in C ? Using MQ API in C language, can we connect to qmgr A and PUT a msg to a queue Q1 residing on qmgr B ( without explicitly connecting to qmgr B ) ?
Or atleast someone please tell me how we can achieve the same thing in C. I know we use Hconn in C ( different from Java).
I am hoping somebody would post a response.
Thanks.
ydsk. |
|
Back to top |
|
 |
wschutz |
Posted: Tue Aug 29, 2006 3:08 pm Post subject: |
|
|
 Jedi Knight
Joined: 02 Jun 2005 Posts: 3316 Location: IBM (retired)
|
ydsk wrote: |
Why don't we have a similar feature in C ? Using MQ API in C language, can we connect to qmgr A and PUT a msg to a queue Q1 residing on qmgr B ( without explicitly connecting to qmgr B ) ?
Or atleast someone please tell me how we can achieve the same thing in C. I know we use Hconn in C ( different from Java).
|
You do, its called the "ObjectQMgrName" in the MQOD .... available in every available language .... _________________ -wayne |
|
Back to top |
|
 |
|