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 » Having problems with INQUIRE_Q_STATUS using PCFMessageAgent

Post new topic  Reply to topic
 Having problems with INQUIRE_Q_STATUS using PCFMessageAgent « View previous topic :: View next topic » 
Author Message
saini
PostPosted: Sun Oct 26, 2003 3:17 pm    Post subject: Having problems with INQUIRE_Q_STATUS using PCFMessageAgent Reply with quote

Novice

Joined: 28 Feb 2002
Posts: 24

My Command server crashes when I run the following code to discover the Queue Status. I have successfully ran other PCF commands without any issues? Can someone help me and let me know what I am doing wrong in this code. Thanks! I am running on Windows XP with mq 5.3.0.4.

PCFMessageAgent agent = null;
try {
agent = new PCFMessageAgent("MYQM7");
PCFMessage request = new PCFMessage(CMQCFC.MQCMD_INQUIRE_Q_STATUS);

request.addParameter(CMQC.MQCA_Q_NAME, "MY.*");
request.addParameter(CMQCFC.MQIACF_Q_STATUS_TYPE, CMQCFC.MQIACF_Q_HANDLE);

PCFMessage[] responses = agent.send(request, true);
for (int i=0; i < responses.length; i++)
{
int openInputHandles = responses[i].getIntParameterValue(CMQC.MQIA_OPEN_INPUT_COUNT);
int openOutputHandles = responses[i].getIntParameterValue(CMQC.MQIA_OPEN_OUTPUT_COUNT);
int currentDepth = responses[i].getIntParameterValue(CMQC.MQIA_CURRENT_Q_DEPTH);
System.out.println("Input:"+openInputHandles+" Output:"+ openOutputHandles + " CurDepth:" + currentDepth);
}
agent.disconnect();
} catch (PCFException pcfe) {
System.err.println("PCF error: " + pcfe);
} catch (MQException mqe) {
System.err.println(mqe);
} catch (IOException ioe) {
System.err.println(ioe);
}
Back to top
View user's profile Send private message
clindsey
PostPosted: Mon Oct 27, 2003 3:05 pm    Post subject: Reply with quote

Knight

Joined: 12 Jul 2002
Posts: 586
Location: Dallas, Tx

Saini,

FWIIW, I ran your code on my Win/2000 workstation and it ran just fine for me. Do you get and FDC files in <mqdir>\errors when the command server dies?

Charlie
Back to top
View user's profile Send private message
saini
PostPosted: Tue Oct 28, 2003 4:19 pm    Post subject: Reply with quote

Novice

Joined: 28 Feb 2002
Posts: 24

I did not see any FDC files. Wonder if this problem is specific to XP. However, I did resolve my issue by adding some more parameters to the request. Problem is resolved for now.

Thanks for all you help.

regards,
-N
Back to top
View user's profile Send private message
Drfischer
PostPosted: Mon Jan 26, 2004 6:49 pm    Post subject: Reply with quote

Newbie

Joined: 26 Jan 2004
Posts: 3

Dear sirs,

I have been trying to get this snip of code to work with MQ5.3 on linux and for the life of me I can't not get it to respond other then a error code 2033.

I have just wraped the code snipit in a main function and it keeps hanging on the send. Any info on how to get the "INQUIRE_Q_STATUS" to work would be very helpfull

Also found out that that command server is crashing with this snipit

thanks
Back to top
View user's profile Send private message
clindsey
PostPosted: Tue Jan 27, 2004 6:28 am    Post subject: Reply with quote

Knight

Joined: 12 Jul 2002
Posts: 586
Location: Dallas, Tx

A common cause of 2033 after sending pcf messages is that the command server is not running.

Run 'dspmqcsv QMGRNAME' to get the status. If it is not active, start it with 'strmqcsv QMGRNAME'. You can omit QMGRNAME if it is the default queue manager.

Charlie
Back to top
View user's profile Send private message
Drfischer
PostPosted: Tue Jan 27, 2004 7:14 am    Post subject: Reply with quote

Newbie

Joined: 26 Jan 2004
Posts: 3

clindsey,
thank you for your reply.

I am finding that the code is crashing my command server. If you have and code examples of INQUIRE_Q_STATUS that would be great. I can post my sample if you would like also..

thanks
Back to top
View user's profile Send private message
clindsey
PostPosted: Tue Jan 27, 2004 12:06 pm    Post subject: Reply with quote

Knight

Joined: 12 Jul 2002
Posts: 586
Location: Dallas, Tx

The only sample I have is C code. You can get it from http://www.developer.ibm.com/tech/sampmq.html
Look for qstatus.c

The command attributes are the same so you can adapt if fairly easily to java if needed.

I would also try removing all messages from SYSTEM.ADMIN.COMMAND.QUEUE before starting the command server to remove any bad messages that may be hanging around there.

Charlie
Back to top
View user's profile Send private message
saini
PostPosted: Tue Jan 27, 2004 5:48 pm    Post subject: Reply with quote

Novice

Joined: 28 Feb 2002
Posts: 24

OK here is another sample that works on LINUX.

try
{
PCFMessage request = new PCFMessage(CMQCFC.MQCMD_INQUIRE_Q_STATUS);
request.addParameter(CMQC.MQCA_Q_NAME, "MY.QUEUE");
request.addParameter(CMQCFC.MQIACF_Q_ATTRS, new int[] {CMQCFC.MQIACF_ALL});
PCFMessage[] responses = agent.send(request);
for (int i = 0; i < responses.length; i++)
{
String queue =
responses[i].getStringParameterValue(CMQC.MQCA_Q_NAME).trim();
int inputHandles = responses[i].getIntParameterValue(CMQC.MQIA_OPEN_INPUT_COUNT);
int outputHandles = responses[i].getIntParameterValue(CMQC.MQIA_OPEN_OUTPUT_COUNT);
int curdepth = responses[i].getIntParameterValue(CMQC.MQIA_CURRENT_Q_DEPTH);
System.out.println("Input:"+inputHandles +" Output:"+ outputHandles + " CurDepth:" + curdepth ); }
}
catch (PCFException pcfe)
{
System.err.println("PCF error: " + pcfe);
}
catch (MQException mqe)
{
System.err.println(mqe);
}


Hope this helps !!!!
rgds,
-S
Back to top
View user's profile Send private message
Drfischer
PostPosted: Wed Jan 28, 2004 6:39 am    Post subject: Reply with quote

Newbie

Joined: 26 Jan 2004
Posts: 3

Thanks!!! that work perfectly.

Now I guess I need to figure why the top example did not work


thanks again
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic  Reply to topic Page 1 of 1

MQSeries.net Forum Index » IBM MQ Java / JMS » Having problems with INQUIRE_Q_STATUS using PCFMessageAgent
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.