|
RSS Feed - WebSphere MQ Support
|
RSS Feed - Message Broker Support
|
 |
|
PCF command to get last put time - Not working! |
« View previous topic :: View next topic » |
Author |
Message
|
Pushkalaa Santhanam |
Posted: Mon Apr 01, 2013 1:56 pm Post subject: PCF command to get last put time - Not working! |
|
|
Newbie
Joined: 12 Aug 2009 Posts: 2
|
Hi,
I am trying to get the last put datetime of a queue, i am using the below code snippet and it isn't working Help!
I am not sure whats worng..
Given below the snippet
PCFMessage request = null ;
request = new PCFMessage (CMQCFC.MQCMD_INQUIRE_Q_STATUS);
request.addParameter (com.ibm.mq.constants.CMQC.MQCA_Q_NAME, "A5");
request.addParameter (CMQCFC.MQIACF_Q_STATUS_ATTRS, CMQCFC.MQIACF_ALL);
PCFMessage [] responses = agent.send (request);
for (int i = 0; i < responses.length; i++)
{
String name = responses [i].getStringParameterValue (com.ibm.mq.constants.CMQC.MQCA_Q_NAME);
String pdate = (responses [i].getStringParameterValue(CMQCFC.MQCACF_LAST_PUT_DATE));
int[] qtime =(responses [i].getIntListParameterValue(CMQCFC.MQIACF_Q_TIME_INDICATOR));
System.out.println (name + "time:"+qtime+"date:" +pdate+"PRINTED");
}
The result is
Trying to connect!
Successfully connected!
Accessing Queue A5!
A5 time:[I@4f444f44date: PRINTED
Ending Queue A5! |
|
Back to top |
|
 |
mqjeff |
Posted: Tue Apr 02, 2013 4:41 am Post subject: |
|
|
Grand Master
Joined: 25 Jun 2008 Posts: 17447
|
Your program is working perfectly, it is producing exactly the result you have asked it to produce.
You should consider altering it so that it produces the result you *want*, instead.
I suspect you'll find that the result you want requires you to understand how to use Java data types properly. |
|
Back to top |
|
 |
Pushkalaa Santhanam |
Posted: Tue Apr 02, 2013 8:25 am Post subject: |
|
|
Newbie
Joined: 12 Aug 2009 Posts: 2
|
I actually want the timestamp of the lastputmessage, in the timestamp(yyyy-mm-dd hh:mm:ss) format.
I am not sure what i am missing , i tried multiple data-types for which all i received only error and only when i use String, i got some display without errors, can you please point out what i am exactly missing out..
It would be really helpful.
I am unable to figure out what i am missing..
Also i tried to convert the array to string with .toString and printed and all i got is [-1,-1]. |
|
Back to top |
|
 |
fjb_saper |
Posted: Tue Apr 02, 2013 11:45 am Post subject: |
|
|
 Grand High Poobah
Joined: 18 Nov 2003 Posts: 20756 Location: LI,NY
|
so who cares about what you want. You first have to evaluate what you receive. Then you can store / print it in the format you want...  _________________ MQ & Broker admin |
|
Back to top |
|
 |
|
|
 |
|
Page 1 of 1 |
|
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
|
|
|
|