Author |
Message
|
jigjim |
Posted: Wed Apr 07, 2004 6:40 am Post subject: PCF Command Q |
|
|
Apprentice
Joined: 30 Mar 2004 Posts: 41
|
Hi,
What System Q and Channel should be used when trying to execute PCF Commands using MQ Client connection. Currently I am using the Channel SYSTEM.DEF.SVRCONN and Q SYSTEM.DEFAULT.LOCAL.QUEUE to send a PCF Command.
I see the Command on the Q but its not executed. I send the reply to a local Q on the same Q manager that I connect to for the SYSTEM.DEFAULT.LOCAL.QUEUE.
I am under the assumption that I can send the reply back to any Local Q on any Q mgr on the MQ Series by specifying that in the sent message header. is that true?
Are there any other parameter such as persistence, time wait, message id ... etc that need to be taken care of ?
Thanks
jigs |
|
Back to top |
|
 |
vennela |
Posted: Wed Apr 07, 2004 7:05 am Post subject: |
|
|
 Jedi Knight
Joined: 11 Aug 2002 Posts: 4055 Location: Hyderabad, India
|
From the manual
Quote: |
The queue to which the PCF commands are sent is always called the SYSTEM.ADMIN.COMMAND.QUEUE. The command server servicing this queue sends the replies to the queue defined by the ReplyToQ and ReplyToQMgr fields in the message descriptor of the command message.
|
So, you shouldn't be sending them to SYSTEM.DEFAULT.LOCAL.QUEUE but to SYSTEM.ADMIN.COMMAND.QUEUE |
|
Back to top |
|
 |
jigjim |
Posted: Wed Apr 07, 2004 7:40 am Post subject: |
|
|
Apprentice
Joined: 30 Mar 2004 Posts: 41
|
Hi,
This is the code I use to put the Command on the System Admin Queue. It gives me a n error code of 2085. Can Somebody help on this?
Does it require any settings to be done on MQ Series Server side ?
In future i wud like to be connected to any Qmgr on the system.
Thanks
Jigs
Code: |
int [] attrs = { CMQC.MQCA_Q_NAME, CMQC.MQIA_CURRENT_Q_DEPTH };
MQCFH cfh;
PCFParameter p;
MQQueueManager qmanager, qmgr;
MQQueue replyQ;
String name = null;
String depth = null;
// MQEnvironment.disableTracing();
// MQEnvironment.enableTracing(0);
MQEnvironment.hostname = args [0];
MQEnvironment.port = Integer.parseInt (args [1]);
MQEnvironment.channel = args [2]; //SYSTEM.DEF.SVRCONN
// MQEnvironment.properties.put (MQC.TRANSPORT_PROPERTY, MQC.TRANSPORT_MQSERIES);
try {
qmanager = new MQQueueManager (""); int openOptions = MQC.MQOO_INPUT_AS_Q_DEF | MQC.MQOO_OUTPUT;
MQQueue sys_def_local_q = qmanager.accessQueue("SYSTEM.ADMIN.COMMAND.QUEUE",openOptions,null,null,null);
MQPutMessageOptions pmo = new MQPutMessageOptions();
MQMessage message = new MQMessage();
message.messageType = MQC.MQMT_REQUEST;
message.format = MQC.MQFMT_ADMIN;
message.replyToQueueManagerName = "MQ02";
message.replyToQueueName = "BRIDGE.TEST.IMS.REPLYTO.QUEUE";
MQCFH.write (message, CMQCFC.MQCMD_INQUIRE_Q, 3); // 3 parameters follow
MQCFST.write (message, CMQC.MQCA_Q_NAME, "*");
MQCFIN.write (message, CMQC.MQIA_Q_TYPE, CMQC.MQQT_ALL);
MQCFIL.write (message, CMQCFC.MQIACF_Q_ATTRS, attrs);
System.out.print ("Sending PCF request... ");
sys_def_local_q.put(message, pmo);
System.out.println ("Sent.");
sys_def_local_q.close();
qmanager.disconnect();
} |
|
|
Back to top |
|
 |
bower5932 |
Posted: Wed Apr 07, 2004 7:45 am Post subject: |
|
|
 Jedi Knight
Joined: 27 Aug 2001 Posts: 3023 Location: Dallas, TX, USA
|
2085 is unknown object. I'd guess that you forgot to define the queue that you want to use. If you're using runmqsc to define it, watch the case. runmqsc folds things to upper case if they aren't in quotes. |
|
Back to top |
|
 |
clindsey |
Posted: Wed Apr 07, 2004 7:55 am Post subject: |
|
|
Knight
Joined: 12 Jul 2002 Posts: 586 Location: Dallas, Tx
|
Jigjim,
Have you looked at supportpac MS0B? It is a set of java classes for dealing with PCF commands. I think it could simplify your life.
Charlie |
|
Back to top |
|
 |
jigjim |
Posted: Wed Apr 07, 2004 8:04 am Post subject: |
|
|
Apprentice
Joined: 30 Mar 2004 Posts: 41
|
the queue is already defined. I wanted to know if there are any specific settings (persistence, Time interval, message id etc) to be set.
I am using ms0b. I set the attributes and parameters (basically construct my command) and send it.
If I do the above code using MQ Series Client as opposed to MQ Client it works.
I therefore wanted to know if anything special has to be done for MQClient connections.
Thanks
Jigs |
|
Back to top |
|
 |
vennela |
Posted: Wed Apr 07, 2004 9:22 am Post subject: |
|
|
 Jedi Knight
Joined: 11 Aug 2002 Posts: 4055 Location: Hyderabad, India
|
Quote: |
the queue is already defined. |
How are you saying that.
If you have the queue then you will not get 2085.
Quote: |
I therefore wanted to know if anything special has to be done for MQClient connections.
|
NO |
|
Back to top |
|
 |
jefflowrey |
Posted: Wed Apr 07, 2004 9:36 am Post subject: |
|
|
Grand Poobah
Joined: 16 Oct 2002 Posts: 19981
|
vennela wrote: |
Quote: |
I therefore wanted to know if anything special has to be done for MQClient connections.
|
NO |
Other than ensuring that the client connection is specified properly. _________________ I am *not* the model of the modern major general. |
|
Back to top |
|
 |
jigjim |
Posted: Wed Apr 07, 2004 9:45 am Post subject: |
|
|
Apprentice
Joined: 30 Mar 2004 Posts: 41
|
Hi,
You are correct. I was on the wrong system. I didnt have the Q defined.
I now have 3 questions:
1. Is it has to be SYSTEM.ADMIN.COMMAND.QUEUE always ? (How abt SYSTEM.CLUSTER.COMMAND.QUEUE which I already have defined)
2. I want to define a Q and a Q manager for my PCF Command. IS it possible it with some other name (rather than SYSTEM..) ?
Is there a place where I can find some more detailed documentation ?
Thanks
Jigs |
|
Back to top |
|
 |
vennela |
Posted: Wed Apr 07, 2004 9:52 am Post subject: |
|
|
 Jedi Knight
Joined: 11 Aug 2002 Posts: 4055 Location: Hyderabad, India
|
1.
Always SYSTEM.ADMIN.COMMAND.QUEUE
3. Look at the Programmable Command Formats and Administration Interface in the Manuals Link |
|
Back to top |
|
 |
clindsey |
Posted: Wed Apr 07, 2004 10:20 am Post subject: |
|
|
Knight
Joined: 12 Jul 2002 Posts: 586 Location: Dallas, Tx
|
Quote: |
I am using ms0b. I set the attributes and parameters (basically construct my command) and send it.
|
I should have been more specific to suggest that you use the PCFAgent or PCFAgentMessage class from ms0b to simplify things.
These classes do restrict you to the use of SYSTEM.ADMIN.COMMAND.QUEUE. If you want to handle your own send method, you can use a different queue. Change the "COMMANDQ" attribute of the queue manager definition to whatever queue you want, but it should be a new queue you define and not one of the other SYSTEM objects.
Charlie |
|
Back to top |
|
 |
|