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 » How to use JAVA PCF to get MQ Queue last message Get time

Post new topic  Reply to topic
 How to use JAVA PCF to get MQ Queue last message Get time « View previous topic :: View next topic » 
Author Message
luck1610
PostPosted: Mon Aug 09, 2010 6:15 am    Post subject: How to use JAVA PCF to get MQ Queue last message Get time Reply with quote

Newbie

Joined: 09 Aug 2010
Posts: 2

Hi,

I am writing PCF in Java code to perform day to day administration task. I am getting problem in one of my module.
I want to retrieved queues status on Last message GET and PUT time.

I wrote below code but it is giving error. If anyone having sample code to accomplish above task then please help.


PCFMessage request2;
PCFMessage [] responses2;
request2 = new PCFMessage(CMQCFC.MQCMD_INQUIRE_Q_STATUS);
request2.addParameter (CMQC.MQCA_Q_NAME, "*");
request2.addParameter (CMQC.MQIA_Q_TYPE, CMQC.MQQT_LOCAL);

request2.addParameter (CMQCFC.MQIACF_Q_STATUS, new int[]{CMQC.MQCA_Q_NAME, CMQCFC.MQCACF_LAST_GET_TIME});
responses2 = agent.send (request2);

// Display the results
for (int k = 0; k < responses2.length; k++)
{
String name2 = responses2[k].getStringParameterValue (CMQC.MQCA_Q_NAME);
int time = responses2[k].getIntParameterValue (CMQCFC.MQCACF_LAST_GET_TIME );

if(!name2.startsWith("SYSTEM.") )
{
out.write( "time " + "\t"+ time );
out.newLine();
}
}
Back to top
View user's profile Send private message
mqjeff
PostPosted: Mon Aug 09, 2010 6:21 am    Post subject: Reply with quote

Grand Master

Joined: 25 Jun 2008
Posts: 17447

"it is giving an error" means "you have not performed proper troubleshooting".

We can't help you with "it is giving an error".

Please explain in detail what the error is.
Back to top
View user's profile Send private message
luck1610
PostPosted: Mon Aug 09, 2010 6:25 am    Post subject: Reply with quote

Newbie

Joined: 09 Aug 2010
Posts: 2

It is giving following error

================
Exception in thread "main" java.lang.ClassCastException: java.lang.String
at com.ibm.mq.pcf.PCFMessage.getIntParameterValue(PCFMessage.java:427)
at PCFMessageListQueueDepth.main(PCFMessageListQueueDepth.java:131)
================

at below line of code.

int time = responses2[k].getIntParameterValue (CMQCFC.MQCACF_LAST_GET_TIME );
Back to top
View user's profile Send private message
joebuckeye
PostPosted: Mon Aug 09, 2010 10:14 am    Post subject: Reply with quote

Partisan

Joined: 24 Aug 2007
Posts: 365
Location: Columbus, OH

You need to look into the type of the data you are requesting.

It is not what you think it is.
Back to top
View user's profile Send private message
mqjeff
PostPosted: Mon Aug 09, 2010 11:05 am    Post subject: Reply with quote

Grand Master

Joined: 25 Jun 2008
Posts: 17447

joebuckeye wrote:
You need to look into the type of the data you are requesting.

It is not what you think it is.


Anything that is identified by an MQCACF is a character value. Anything identified by an MQIACF is an integer value.

Oddly enough, that's what the I and the C stand for.
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 » How to use JAVA PCF to get MQ Queue last message Get time
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.