Author |
Message
|
HubertKleinmanns |
Posted: Wed Sep 11, 2019 6:16 am Post subject: |
|
|
 Shaman
Joined: 24 Feb 2004 Posts: 732 Location: Germany
|
pcouas wrote: |
Sorry
DISPLAY QSTATUS(E.MQEMMO2.MQEMMO3.X.205.QL) IPPROCS OPPROCS
--> OPPROCS(1)
DISPLAY QSTATUS(E.MQEMMO2.MQEMMO3.X.205.QL) TYPE(HANDLE) APPLTAG
--> APPLTAG(amqrmppa) |
I was a second to late with my last thread.
The process "amqrmppa" has opend the queue for writing - and so you cannot at all CLEAR the queue.
A command
Code: |
DISPLAY QSTATUS(E.MQEMMO2.MQEMMO3.X.205.QL) TYPE(HANDLE) CHANNEL |
would show the name of the channel. _________________ Regards
Hubert |
|
Back to top |
|
 |
bruce2359 |
Posted: Wed Sep 11, 2019 6:18 am Post subject: |
|
|
 Poobah
Joined: 05 Jan 2008 Posts: 9469 Location: US: west coast, almost. Otherwise, enroute.
|
pcouas wrote: |
Humm
I create the Queue with Java program and i test it by sending and reading message in this new Queue !
I juste want be sure there is no new messsage in tis Queue
Regards |
The next time the app attempts to consume a message, a 2033 r/c will be thrown. r/c 2033 means 'no message available.' _________________ I like deadlines. I like to wave as they pass by.
ב''ה
Lex Orandi, Lex Credendi, Lex Vivendi. As we Worship, So we Believe, So we Live. |
|
Back to top |
|
 |
HubertKleinmanns |
Posted: Wed Sep 11, 2019 6:20 am Post subject: |
|
|
 Shaman
Joined: 24 Feb 2004 Posts: 732 Location: Germany
|
Vitor wrote: |
Then in your place I would be very interested to discover why this queue manager process feels the need to open a handle to it. |
pcouas, does your Java process come across a channel? Maybe, that you lock yourself? _________________ Regards
Hubert |
|
Back to top |
|
 |
HubertKleinmanns |
Posted: Wed Sep 11, 2019 6:27 am Post subject: |
|
|
 Shaman
Joined: 24 Feb 2004 Posts: 732 Location: Germany
|
bruce2359 wrote: |
The next time the app attempts to consume a message, a 2033 r/c will be thrown. r/c 2033 means 'no message available.' |
As long as you do not read with CorrelID or MsgID or JMS selectors etc.
But a "DISPLAY QSTATUS ... CURDEPTH UNCOM" would help. The result must be:
Code: |
AMQ8450I: Display queue status details.
...
CURDEPTH(0) UNCOM(NO) |
_________________ Regards
Hubert |
|
Back to top |
|
 |
Vitor |
Posted: Wed Sep 11, 2019 6:35 am Post subject: |
|
|
 Grand High Poobah
Joined: 11 Nov 2005 Posts: 26093 Location: Texas, USA
|
HubertKleinmanns wrote: |
Vitor wrote: |
Then in your place I would be very interested to discover why this queue manager process feels the need to open a handle to it. |
pcouas, does your Java process come across a channel? Maybe, that you lock yourself? |
Shush.......he'll figure out it's the SVRCONN by himself in a minute.....
 _________________ Honesty is the best policy.
Insanity is the best defence. |
|
Back to top |
|
 |
HubertKleinmanns |
Posted: Wed Sep 11, 2019 6:41 am Post subject: |
|
|
 Shaman
Joined: 24 Feb 2004 Posts: 732 Location: Germany
|
Vitor wrote: |
Shush.......he'll figure out it's the SVRCONN by himself in a minute.....
 |
 _________________ Regards
Hubert |
|
Back to top |
|
 |
pcouas |
Posted: Wed Sep 11, 2019 7:15 am Post subject: |
|
|
Voyager
Joined: 06 Sep 2011 Posts: 79
|
Yes i replace Clear by testing messages number
It'seems Channel as an timeout before closing !
Regards |
|
Back to top |
|
 |
Vitor |
Posted: Wed Sep 11, 2019 7:20 am Post subject: |
|
|
 Grand High Poobah
Joined: 11 Nov 2005 Posts: 26093 Location: Texas, USA
|
pcouas wrote: |
It'seems Channel as an timeout before closing ! |
Really? I always wondered what those parameters on the channel definitions were for.
 _________________ Honesty is the best policy.
Insanity is the best defence. |
|
Back to top |
|
 |
bruce2359 |
Posted: Wed Sep 11, 2019 7:22 am Post subject: |
|
|
 Poobah
Joined: 05 Jan 2008 Posts: 9469 Location: US: west coast, almost. Otherwise, enroute.
|
Vitor wrote: |
pcouas wrote: |
It'seems Channel as an timeout before closing ! |
Really? I always wondered what those parameters on the channel definitions were for.
 |
Sarcasm. _________________ I like deadlines. I like to wave as they pass by.
ב''ה
Lex Orandi, Lex Credendi, Lex Vivendi. As we Worship, So we Believe, So we Live. |
|
Back to top |
|
 |
Vitor |
Posted: Wed Sep 11, 2019 7:24 am Post subject: |
|
|
 Grand High Poobah
Joined: 11 Nov 2005 Posts: 26093 Location: Texas, USA
|
bruce2359 wrote: |
Vitor wrote: |
pcouas wrote: |
It'seems Channel as an timeout before closing ! |
Really? I always wondered what those parameters on the channel definitions were for.
 |
Sarcasm. |
"Do you know what irony is Baldrick?"
"Yes, it's like goldy or silvery but made of iron" _________________ Honesty is the best policy.
Insanity is the best defence. |
|
Back to top |
|
 |
HubertKleinmanns |
Posted: Wed Sep 11, 2019 7:27 am Post subject: |
|
|
 Shaman
Joined: 24 Feb 2004 Posts: 732 Location: Germany
|
Vitor wrote: |
bruce2359 wrote: |
Vitor wrote: |
pcouas wrote: |
It'seems Channel as an timeout before closing ! |
Really? I always wondered what those parameters on the channel definitions were for.
 |
Sarcasm. |
"Do you know what irony is Baldrick?"
"Yes, it's like goldy or silvery but made of iron" |
 _________________ Regards
Hubert |
|
Back to top |
|
 |
pcouas |
Posted: Wed Sep 11, 2019 11:25 pm Post subject: |
|
|
Voyager
Joined: 06 Sep 2011 Posts: 79
|
Hi
Thanks for answer to an poor french Dev with no humour !
My new code to avoid clear
Code: |
private Boolean isMessagesInQueue(String objectName, MqQmanager qm) throws PCFException, MQException, IOException, JrafMQException {
Boolean isMessageInQueue=true;
PCFMessageAgent pcfMessageAgent = null;
try {
PCFMessage request = new PCFMessage(CMQCFC.MQCMD_INQUIRE_Q_STATUS);
request.addParameter(CMQC.MQCA_Q_NAME, objectName);
request.addParameter(CMQCFC.MQIACF_Q_STATUS_ATTRS, new int[] { CMQC.MQIA_CURRENT_Q_DEPTH,CMQC.MQIA_OPEN_INPUT_COUNT,CMQC.MQIA_OPEN_OUTPUT_COUNT,CMQCFC.MQIACF_UNCOMMITTED_MSGS});
pcfMessageAgent = openNewPCFMessageAgent(qm);
PCFMessage[] responses = pcfMessageAgent.send(request);
for (int i = 0; i < responses.length; i++) {
if (((responses[i]).getCompCode() == CMQC.MQCC_OK) && ((responses[i]).getParameterValue(CMQC.MQCA_Q_NAME) != null)) {
String name = responses[i].getStringParameterValue(CMQC.MQCA_Q_NAME);
if (name != null) {
name = name.trim();
}
Integer iprocs = responses[i].getIntParameterValue(CMQC.MQIA_OPEN_INPUT_COUNT);
//Integer oprocs = responses[i].getIntParameterValue(CMQC.MQIA_OPEN_OUTPUT_COUNT); //Peut etre a 1
Integer depth = responses[i].getIntParameterValue(CMQC.MQIA_CURRENT_Q_DEPTH);
Integer uncom= responses[i].getIntParameterValue(CMQCFC.MQIACF_UNCOMMITTED_MSGS);
if(depth==0 && uncom==0 && iprocs==0){
isMessageInQueue=false;
}
}
}
} catch (MQException ex) {
log.info("objet non trouve sur le Qmanager objectName:" + objectName + " reason:" + ex.getReason());
throw new JrafMQObjetException(objectName, qm.getName(), clazz, ex);
} finally {
closePCFMessageAgent(qm.getName(), pcfMessageAgent);
}
return isMessageInQueue;
}
|
PS
sorry for english level
Regards |
|
Back to top |
|
 |
Vitor |
Posted: Thu Sep 12, 2019 5:04 am Post subject: |
|
|
 Grand High Poobah
Joined: 11 Nov 2005 Posts: 26093 Location: Texas, USA
|
pcouas wrote: |
PS
sorry for english level
|
We don't require good English in here; many posters are American and would struggle to achieve that.
I'm unclear what this code is intended to achieve. In the sense I'm not clear why you're trying to clear the queue, and if you are, why you're not altering the channel definition to a more suitable timeout value.
(You are, of course, not using any of the SYSTEM SVRCONN channels defined as part of the queue manager are you? You wouldn't be performing such a level of bad practice).
I mean if (for example) you want to empty the queue so that there are no messages on it prior to a new round of testing and there's an IPPROCS on the queue, why not simply you amqsget / RFHUtil / A.N.Other utility to destructively read all the messages off? Why so desparate to use CLEAR QUEUE? _________________ Honesty is the best policy.
Insanity is the best defence. |
|
Back to top |
|
 |
bruce2359 |
Posted: Thu Sep 12, 2019 5:32 am Post subject: |
|
|
 Poobah
Joined: 05 Jan 2008 Posts: 9469 Location: US: west coast, almost. Otherwise, enroute.
|
In other words, why the requirement to use the CLEAR QLOCAL administrative command? _________________ I like deadlines. I like to wave as they pass by.
ב''ה
Lex Orandi, Lex Credendi, Lex Vivendi. As we Worship, So we Believe, So we Live. |
|
Back to top |
|
 |
Vitor |
Posted: Thu Sep 12, 2019 5:51 am Post subject: |
|
|
 Grand High Poobah
Joined: 11 Nov 2005 Posts: 26093 Location: Texas, USA
|
bruce2359 wrote: |
In other words, why the requirement to use the CLEAR QLOCAL administrative command? |
Oui. _________________ Honesty is the best policy.
Insanity is the best defence. |
|
Back to top |
|
 |
|