Author |
Message
|
iceage |
Posted: Wed Mar 14, 2012 2:55 pm Post subject: PCFMessageAgent - SetWaitInterval not working. |
|
|
 Acolyte
Joined: 12 Apr 2006 Posts: 68
|
Has anybody able to bypass the default 30 second interval for PCFMessageagent in java ? I am trying to specify the interval using SetWaitInterval method , irrespective of the value specified it always defaults to 30 seconds.
Or does it have to be PCFAgent ?
MQ environment : Windows MQ 7016 |
|
Back to top |
|
 |
iceage |
Posted: Thu Mar 15, 2012 8:10 am Post subject: |
|
|
 Acolyte
Joined: 12 Apr 2006 Posts: 68
|
Tried with PCFAgent class too , still the same behavior , doesn't honor setWaitInterval values. Can anybody share experience ?
Here is the code snippet for reference ..
Code: |
PCFAgent agent = new PCFAgent ("localhost", 1414, "CLIENT");
MQMessage [] responses;
PCFParameter [] parameters =
{
new MQCFST (CMQC.MQCA_Q_NAME, "*"),
new MQCFIN (CMQC.MQIA_Q_TYPE, MQC.MQQT_LOCAL)
};
MQCFH cfh;
MQCFSL cfsl;
agent.setWaitInterval(5000);
responses = agent.send (CMQCFC.MQCMD_INQUIRE_Q_NAMES, parameters); |
|
|
Back to top |
|
 |
fjb_saper |
Posted: Thu Mar 15, 2012 8:20 pm Post subject: |
|
|
 Grand High Poobah
Joined: 18 Nov 2003 Posts: 20756 Location: LI,NY
|
And it takes you more than 30 seconds to get the results to that query?
What kind of environment are you running?
Any network latency?
 _________________ MQ & Broker admin |
|
Back to top |
|
 |
rekarm01 |
Posted: Fri Mar 16, 2012 1:12 am Post subject: Re: PCFMessageAgent - SetWaitInterval not working. |
|
|
Grand Master
Joined: 25 Jun 2008 Posts: 1415
|
iceage wrote: |
Tried with PCFAgent class too, still the same behavior, doesn't honor setWaitInterval values. |
What is this "same behavior"? Is it waiting too long, or not long enough?
iceage wrote: |
Code: |
agent.setWaitInterval(5000); |
|
The PCFAgent.setWaitInterval() value is expressed in seconds, (not milliseconds). 5000 seconds is probably more than enough time to complete most any PCF query. |
|
Back to top |
|
 |
iceage |
Posted: Mon Mar 19, 2012 9:24 am Post subject: |
|
|
 Acolyte
Joined: 12 Apr 2006 Posts: 68
|
Quote: |
What is this "same behavior"? Is it waiting too long, or not long enough? |
Not long enough , now that it stuck me , its seconds (though it was very explicit in manual , didn't really catch it ..) .. i will attempt a smaller value and see if that's make it work .. For now its NOT waiting 5000 seconds , will update if it waits 100 seconds after testing .. |
|
Back to top |
|
 |
iceage |
Posted: Mon Mar 19, 2012 2:02 pm Post subject: |
|
|
 Acolyte
Joined: 12 Apr 2006 Posts: 68
|
still the same with setWaitInterval(100) , it wouldn't wait 100 seconds will return in 30 seconds (default) .. !!! |
|
Back to top |
|
 |
JasonE |
Posted: Tue Mar 20, 2012 5:25 am Post subject: |
|
|
Grand Master
Joined: 03 Nov 2003 Posts: 1220 Location: Hursley
|
So how are you testing this - ie how are you making a PCF response take >30 seconds?
I tried by killing off the command server and saw exactly what you are saying, BUT when I looked in the debugger the problem is that the creation of the PCFAgent object itself connects to the qmgr and does something, and you havent yet set the timeout at that point (you cant!). |
|
Back to top |
|
 |
iceage |
Posted: Tue Mar 20, 2012 8:18 pm Post subject: |
|
|
 Acolyte
Joined: 12 Apr 2006 Posts: 68
|
Yes i do the same , end the command server , execute program to send PCF message and time it when it returns back.
What i also observed is PCF command message is sent always with expiry of 300 seconds
Quote: |
BUT when I looked in the debugger the problem is that the creation of the PCFAgent object itself connects to the qmgr and does something, and you havent yet set the timeout at that point (you cant!). |
Please clarify this. And would it work for desired wait interval had we not forced timeout condition by stopping command server ?
Many thanks for your help. |
|
Back to top |
|
 |
|