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 API Support » Inquire parameters from QM_1 via QM_2 with PCF Java API?

Post new topic  Reply to topic Goto page 1, 2  Next
 Inquire parameters from QM_1 via QM_2 with PCF Java API? « View previous topic :: View next topic » 
Author Message
Suessli
PostPosted: Wed Mar 11, 2009 5:55 am    Post subject: Inquire parameters from QM_1 via QM_2 with PCF Java API? Reply with quote

Novice

Joined: 29 Jan 2008
Posts: 15

Hi everyone,

is this possible. Anyone examples for me?
How do I tell the PCFAgent that he should connect to QM_2 but get information from QM_1?
_________________
Suessli
Back to top
View user's profile Send private message
Vitor
PostPosted: Wed Mar 11, 2009 5:58 am    Post subject: Re: Inquire parameters from QM_1 via QM_2 with PCF Java API? Reply with quote

Grand High Poobah

Joined: 11 Nov 2005
Posts: 26093
Location: Texas, USA

Suessli wrote:
How do I tell the PCFAgent that he should connect to QM_2 but get information from QM_1?


Use QM_2 to redirect the PCF message to QM_1. Standard request/reply/remote queue stuff.
_________________
Honesty is the best policy.
Insanity is the best defence.
Back to top
View user's profile Send private message
Suessli
PostPosted: Wed Mar 11, 2009 6:11 am    Post subject: Re: Inquire parameters from QM_1 via QM_2 with PCF Java API? Reply with quote

Novice

Joined: 29 Jan 2008
Posts: 15

Vitor wrote:

Use QM_2 to redirect the PCF message to QM_1. Standard request/reply/remote queue stuff.


So you want to tell me that this is not possibla with the Admin API and I have to use MQ API instead? That is just great ...
_________________
Suessli
Back to top
View user's profile Send private message
Vitor
PostPosted: Wed Mar 11, 2009 6:14 am    Post subject: Re: Inquire parameters from QM_1 via QM_2 with PCF Java API? Reply with quote

Grand High Poobah

Joined: 11 Nov 2005
Posts: 26093
Location: Texas, USA

Suessli wrote:
So you want to tell me that this is not possibla with the Admin API and I have to use MQ API instead? That is just great ...


I want to tell you nothing of the kind!

Unless there's something weird about the PCFAgent I'm unaware of that locks it to a specific location. Possible, given my level of Java knowledge.

But in concept it should be straightforward enough.
_________________
Honesty is the best policy.
Insanity is the best defence.
Back to top
View user's profile Send private message
Suessli
PostPosted: Wed Mar 11, 2009 6:22 am    Post subject: Re: Inquire parameters from QM_1 via QM_2 with PCF Java API? Reply with quote

Novice

Joined: 29 Jan 2008
Posts: 15

Vitor wrote:

I want to tell you nothing of the kind!

Unless there's something weird about the PCFAgent I'm unaware of that locks it to a specific location. Possible, given my level of Java knowledge.

But in concept it should be straightforward enough.


I think I understand the concept but I have no idea how to tell the PCFAgent to forward my request to QM_1. I am creating new PCF Agent via

Code:

new PCFAgent(host, port, channel);


so it connects directly to the queue manager runing under host X and with port Y. Now I found nothing about a method or constant which allows me to forward my request. However MO71 has the option to do this. So I think it is possible. But ... how?!
_________________
Suessli
Back to top
View user's profile Send private message
Vitor
PostPosted: Wed Mar 11, 2009 6:27 am    Post subject: Reply with quote

Grand High Poobah

Joined: 11 Nov 2005
Posts: 26093
Location: Texas, USA

Ah - so it is some weird Java thing I'm unaware of!

Clearly the PCFAgent is directly attaching to the queue manager in question rather than simply generating a PCF message. So you're right, it's not possible with PCFAgent.

Time to RYO PCF messages methinks.....
_________________
Honesty is the best policy.
Insanity is the best defence.
Back to top
View user's profile Send private message
mqjeff
PostPosted: Wed Mar 11, 2009 6:31 am    Post subject: Reply with quote

Grand Master

Joined: 25 Jun 2008
Posts: 17447

You don't tell the Agent to connect to the remote queue manager. You construct PCFMessages that are destined for the remote queue manager.
Back to top
View user's profile Send private message
Vitor
PostPosted: Wed Mar 11, 2009 6:34 am    Post subject: Reply with quote

Grand High Poobah

Joined: 11 Nov 2005
Posts: 26093
Location: Texas, USA

mqjeff wrote:
You don't tell the Agent to connect to the remote queue manager. You construct PCFMessages that are destined for the remote queue manager.


Now I thought that, until all these connection details started getting bandied about.....
_________________
Honesty is the best policy.
Insanity is the best defence.
Back to top
View user's profile Send private message
Suessli
PostPosted: Wed Mar 11, 2009 6:37 am    Post subject: Reply with quote

Novice

Joined: 29 Jan 2008
Posts: 15

mqjeff wrote:
You don't tell the Agent to connect to the remote queue manager. You construct PCFMessages that are destined for the remote queue manager.


Jeff I am constructing a PCFMessage as follows.

Code:

PCFMessage request = new PCFMessage (CMQCFC.MQCMD_INQUIRE_Q);
request.addParameter (CMQC.MQCA_Q_NAME, "*");


How do I construct this message for a remote queue manager? Can you provide code examples?

I was trying the following

Code:

request.addParameter(CMQC.MQCA_Q_MGR_NAME, qMgr);


but then I am getting MQRC 3016 which is MQRCCF_MSG_LENGTH_ERROR.
_________________
Suessli
Back to top
View user's profile Send private message
mqjeff
PostPosted: Wed Mar 11, 2009 6:41 am    Post subject: Reply with quote

Grand Master

Joined: 25 Jun 2008
Posts: 17447

I'd suggest you use a different constructor from the PCFMessage class.
Back to top
View user's profile Send private message
Suessli
PostPosted: Wed Mar 11, 2009 6:47 am    Post subject: Reply with quote

Novice

Joined: 29 Jan 2008
Posts: 15

mqjeff wrote:
I'd suggest you use a different constructor from the PCFMessage class.


Can you please be more specific. Which constructor do you mean?
_________________
Suessli
Back to top
View user's profile Send private message
fjb_saper
PostPosted: Wed Mar 11, 2009 7:57 pm    Post subject: Reply with quote

Grand High Poobah

Joined: 18 Nov 2003
Posts: 20756
Location: LI,NY

Search for one that allows you to set the destination qmgr and queue on the MQMD. Have fun
_________________
MQ & Broker admin
Back to top
View user's profile Send private message Send e-mail
Suessli
PostPosted: Thu Mar 12, 2009 2:06 am    Post subject: Reply with quote

Novice

Joined: 29 Jan 2008
Posts: 15

I was trying it as follows.

Code:

MQEnvironment.hostname = "XXX";
      MQEnvironment.port = 1414;
      MQEnvironment.channel = "XXX";
      
      MQEnvironment.userID = "xxx";
      try {
         // connecting
         MQQueueManager qmgr = new MQQueueManager("XXX");
         // connected
         
         // open pcf request and reply queue
         String replyQueueName = "PCF.REPLY";
         MQQueue adminQueue = qmgr.accessQueue(
               qmgr.getCommandInputQueueName(),
               MQC.MQOO_INPUT_EXCLUSIVE, "", "", "mqm");
         MQQueue replyQueue = qmgr.accessQueue (
               "SYSTEM.DEFAULT.MODEL.QUEUE",
               MQC.MQOO_INPUT_EXCLUSIVE, "", replyQueueName, "mqm");
         
         // generate request
         MQMessage message = new MQMessage();
         
         message.messageType = MQC.MQMT_REQUEST;
         message.expiry = 100;
         message.feedback = MQC.MQFB_NONE;
         message.format = MQC.MQFMT_ADMIN;
         message.replyToQueueManagerName = "XXX";
         message.replyToQueueName = replyQueueName;
         
         PCFMessage request = new PCFMessage(CMQCFC.MQCMD_INQUIRE_Q);
         request.addParameter (CMQC.MQCA_Q_NAME, "*");
         request.addParameter (CMQC.MQIA_Q_TYPE, CMQC.MQQT_LOCAL);
         request.addParameter (CMQCFC.MQIACF_Q_ATTRS,
            new int [] { CMQC.MQCA_Q_NAME, CMQC.MQIA_CURRENT_Q_DEPTH });
         request.write(message);

         MQPutMessageOptions pmo = new MQPutMessageOptions ();
         // sending request
         adminQueue.put(message, pmo);
         // send
         
         
      } catch (MQException e) {
         // TODO Auto-generated catch block
         e.printStackTrace();
      } catch (IOException e) {
         // TODO Auto-generated catch block
         e.printStackTrace();
      }


But there is simply no option where I can set the destination queue manager YYY MQMessage does not provide s.th. like destination queue manager. Nobody was trying this?
_________________
Suessli
Back to top
View user's profile Send private message
mqjeff
PostPosted: Thu Mar 12, 2009 3:37 am    Post subject: Reply with quote

Grand Master

Joined: 25 Jun 2008
Posts: 17447

Sorry,I was not thinking it through clearly.

You need to use a different connect method.
Back to top
View user's profile Send private message
Suessli
PostPosted: Thu Mar 12, 2009 4:45 am    Post subject: Reply with quote

Novice

Joined: 29 Jan 2008
Posts: 15

mqjeff wrote:
...
You need to use a different connect method.


Thanks for this hint Jeff. Using this method

Code:

connect(com.ibm.mq.MQQueueManager qmanager, java.lang.String targetQueue, java.lang.String targetQmanager)


helped
_________________
Suessli
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic  Reply to topic Goto page 1, 2  Next Page 1 of 2

MQSeries.net Forum Index » IBM MQ API Support » Inquire parameters from QM_1 via QM_2 with PCF Java API?
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.