Author |
Message
|
mitul |
Posted: Tue Jul 20, 2004 12:31 pm Post subject: MQGet call going in a dead lock |
|
|
Apprentice
Joined: 13 Jun 2002 Posts: 33
|
An application is putting messages on Q1.
There is a daemon process (a java thread program) that polls the queue (Q1) after 1000 ms and checks for messages.
If there are messages on the queue (Q1) then the program gets the message in the browse mode and passes it to a message processing module (another java program).
Once the successful processing is done there, the control is passed back to the thread program and a new response message is written to another queue (Q2).
Once the response message is written on the other queue (Q2) we are doing a destructive get for the original message from the Q1.
After this the process of continues.
The problem that is occuring is - after the Application A puts the mssg on Q1, the daemon process starts porcessing messages, it puts the response messages on Q2 and simultaneously keeps doing a destructive get for that relevant message from Q1. After this cycle is completed for 3-4 rounds the process stops.. and nothing seems to work.
The log statements written in the program show that messages are still there on the queue and MQ Get call is the last statement that was trying to execute... Process is still on but nothing is getting logged.
I have to manually kill this process and start it again to get the remaining chunk of messages. But the same keeps repeating.
Is there some kind of dead lock being obtained...?
How do i solve this problem.
Just for your info for retrieving the messg this is what I am doing..
// open options for the Queue
openOptions = MQC.MQOO_FAIL_IF_QUIESCING +
MQC.MQOO_INQUIRE + MQC.MQOO_INPUT_AS_Q_DEF;
// Get messg options
gmo = new MQGetMessageOptions ();
gmo.options = MQC.MQGMO_FAIL_IF_QUIESCING +
MQC.MQGMO_WAIT;
gmo.waitInterval = MQC.MQWI_UNLIMITED;
queue.get(msg,gmo);
Can you also explain me the significance of the gmo specified above..?
What does the above options do..?
regards,
mitul |
|
Back to top |
|
 |
fjb_saper |
Posted: Tue Jul 20, 2004 12:49 pm Post subject: |
|
|
 Grand High Poobah
Joined: 18 Nov 2003 Posts: 20756 Location: LI,NY
|
Your process does not hang. It waits for messages...
You have a get with wait but not time limit on your wait.
If there are other messages on the queue .. are they committed (i.e. gettable ?)
Are you forgetting to clear a filter and looking for specific messages so that the messages on the queue are " filtered out " ?
Hope that helps some.
 |
|
Back to top |
|
 |
mitul |
Posted: Tue Jul 20, 2004 12:52 pm Post subject: |
|
|
Apprentice
Joined: 13 Jun 2002 Posts: 33
|
The messages are commited.
What are you trying to say with respect to filetering. Can you pls elaborate on this..?
Also why is it that killing the process and starting it agina solves the problem temporarily..?
If i don't specify these GMO are there any other options..? |
|
Back to top |
|
 |
fjb_saper |
Posted: Tue Jul 20, 2004 1:31 pm Post subject: |
|
|
 Grand High Poobah
Joined: 18 Nov 2003 Posts: 20756 Location: LI,NY
|
Read the manual: Using java in documentation link on this site.
It will explain all the rest.
 |
|
Back to top |
|
 |
bower5932 |
Posted: Tue Jul 20, 2004 1:55 pm Post subject: |
|
|
 Jedi Knight
Joined: 27 Aug 2001 Posts: 3023 Location: Dallas, TX, USA
|
Regarding 'filtering', you might want to look at the Application Programming Guide & Reference. You are probably leaving your message id and correlation id populated with IDs from the previous message so that a filter is being applied (and not met) to subsequent gets. |
|
Back to top |
|
 |
mitul |
Posted: Tue Jul 20, 2004 2:25 pm Post subject: |
|
|
Apprentice
Joined: 13 Jun 2002 Posts: 33
|
Hey but i am anyways doing the following just before doing the get()
msg.clearMessage();
and setting the messageID to "MQC.MQMI_NONE"
and how is that it is working for first 4-5 msgs and then it stops..? |
|
Back to top |
|
 |
|