ASG
IBM
Zystems
Cressida
Icon
Netflexity
 
  MQSeries.net
Search  Search       Tech Exchange      Education      Certifications      Library      Info Center      SupportPacs      LinkedIn  Search  Search                                                                   FAQ  FAQ   Usergroups  Usergroups
 
Register  ::  Log in Log in to check your private messages
 
RSS Feed - WebSphere MQ Support RSS Feed - Message Broker Support

MQSeries.net Forum Index » IBM MQ Java / JMS » accessQueue method - a basic question

Post new topic  Reply to topic
 accessQueue method - a basic question « View previous topic :: View next topic » 
Author Message
ydsk
PostPosted: Mon Aug 28, 2006 8:09 pm    Post subject: accessQueue method - a basic question Reply with quote

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
View user's profile Send private message
ydsk
PostPosted: Tue Aug 29, 2006 7:15 am    Post subject: Reply with quote

Chevalier

Joined: 23 May 2005
Posts: 410

Can someone pls help me with my question above.

Thanks in advance.
ydsk.
Back to top
View user's profile Send private message
jefflowrey
PostPosted: Tue Aug 29, 2006 10:44 am    Post subject: Reply with quote

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
View user's profile Send private message
ydsk
PostPosted: Tue Aug 29, 2006 11:11 am    Post subject: Reply with quote

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
View user's profile Send private message
wschutz
PostPosted: Tue Aug 29, 2006 11:20 am    Post subject: Reply with quote

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
View user's profile Send private message Send e-mail AIM Address
ydsk
PostPosted: Tue Aug 29, 2006 1:39 pm    Post subject: Reply with quote

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
View user's profile Send private message
saketr
PostPosted: Tue Aug 29, 2006 1:44 pm    Post subject: Reply with quote

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
View user's profile Send private message
jefflowrey
PostPosted: Tue Aug 29, 2006 2:00 pm    Post subject: Reply with quote

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
View user's profile Send private message
ydsk
PostPosted: Tue Aug 29, 2006 2:29 pm    Post subject: Reply with quote

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
View user's profile Send private message
wschutz
PostPosted: Tue Aug 29, 2006 3:08 pm    Post subject: Reply with quote

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
View user's profile Send private message Send e-mail AIM Address
Display posts from previous:   
Post new topic  Reply to topic Page 1 of 1

MQSeries.net Forum Index » IBM MQ Java / JMS » accessQueue method - a basic question
Jump to:  



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
Protected by Anti-Spam ACP
 
 


Theme by Dustin Baccetti
Powered by phpBB © 2001, 2002 phpBB Group

Copyright © MQSeries.net. All rights reserved.