Author |
Message
|
gayathri |
Posted: Fri Jun 17, 2005 3:58 am Post subject: getCurrentDepth |
|
|
Apprentice
Joined: 07 Jun 2005 Posts: 36
|
Hi,
A mainframe application puts the message in the MQ server
A java program running in a different machine picks up the message and process the message.
Still if 10 messages are PUT in the queue only nine messages are getting processed.
Please help me to solve this issue.
Thanks in advance.
Gayathri |
|
Back to top |
|
 |
gayathri |
Posted: Fri Jun 17, 2005 4:05 am Post subject: getCurrentDepth |
|
|
Apprentice
Joined: 07 Jun 2005 Posts: 36
|
Hi,
A mainframe application is putting messages in the MQ server
A java program reads the messages from the queue.
If 10 messages are written at the sender's end only 9 messages are getting processed at the receiver end.
I don't understand how the trigger option is set in the queue.
I am using MQI calls in Java program. I associate a listener thread to the queue and when the message enters the queue immediately the queue picks up the message and processes it.
Please help me to solve this problem.
Gayathri |
|
Back to top |
|
 |
jefflowrey |
Posted: Fri Jun 17, 2005 4:12 am Post subject: |
|
|
Grand Poobah
Joined: 16 Oct 2002 Posts: 19981
|
Close down your java program.
Have the mainframe send messages.
Run the amqsbcg or amqsbcgc sample program (depending on if you are using a server or a client). Make note of the output. Determine if any messages are missing. If they are, the problem is the mainframe.
Run your program. Determine if any messages are missing. If they are, compare the output of amqsbcg to see which one - the first, the last, etc.
Read your own code again, carefully. Pretend to be the computer, and "run the program" in your head.
Use the java debugger, and step through your code, watching each line and seeing what is going on. _________________ I am *not* the model of the modern major general. |
|
Back to top |
|
 |
gayathri |
Posted: Fri Jun 17, 2005 4:52 am Post subject: getCurrentDepth |
|
|
Apprentice
Joined: 07 Jun 2005 Posts: 36
|
Hi,
I am a java person. I don't know anything about mainframes. So please let me know how to run the sample program you have specified in your reply.
Gayathri |
|
Back to top |
|
 |
jefflowrey |
Posted: Fri Jun 17, 2005 4:57 am Post subject: |
|
|
Grand Poobah
Joined: 16 Oct 2002 Posts: 19981
|
It's not a mainframe program.
It's installed on every queue manager machine that has the Samples installed. It will also be installed on every client machine that has Samples installed.
You run it from the command line. _________________ I am *not* the model of the modern major general. |
|
Back to top |
|
 |
gayathri |
Posted: Mon Jul 11, 2005 10:48 pm Post subject: |
|
|
Apprentice
Joined: 07 Jun 2005 Posts: 36
|
Hi,
I understand from the API reference that SYNC_POINT is to delay the commit until all the actions in the UOW is complete.
I just write a message in the queue with no sync_point option specified.
But if I write "N" messages "N-1" messages are getting written. I don't see any necessity to add SYNC_POINT either in GET or PUT.
If I use SYNC_POINT in PMO should I use it in GMO also?
Please advice me what can be done to fix this. |
|
Back to top |
|
 |
bower5932 |
Posted: Tue Jul 12, 2005 5:38 am Post subject: |
|
|
 Jedi Knight
Joined: 27 Aug 2001 Posts: 3023 Location: Dallas, TX, USA
|
gayathri wrote: |
But if I write "N" messages "N-1" messages are getting written. I don't see any necessity to add SYNC_POINT either in GET or PUT.
If I use SYNC_POINT in PMO should I use it in GMO also? |
The decision to use or not use syncpointing is usually based on business needs rather than what the MQ API will do or not do. As far as whether to use it on PMO and GMO, my guess is that if it was important enough for the put, it is probably important enough for the get. |
|
Back to top |
|
 |
fjb_saper |
Posted: Tue Jul 12, 2005 1:58 pm Post subject: |
|
|
 Grand High Poobah
Joined: 18 Nov 2003 Posts: 20756 Location: LI,NY
|
gayathri wrote: |
But if I write "N" messages "N-1" messages are getting written. |
How did you verify this ?
 |
|
Back to top |
|
 |
gayathri |
Posted: Tue Jul 12, 2005 8:28 pm Post subject: |
|
|
Apprentice
Joined: 07 Jun 2005 Posts: 36
|
Hi,
I have Windows based MQServer installed in my machine. I verified this
with that.
I fixed this with the following
pmo.options = pmo.options | MQC.MQPMO_SYNCPOINT
mqManager.commit();
But the same fix does not work in the mainframe program.
Thanks,
Gayathri |
|
Back to top |
|
 |
bower5932 |
Posted: Wed Jul 13, 2005 6:15 am Post subject: |
|
|
 Jedi Knight
Joined: 27 Aug 2001 Posts: 3023 Location: Dallas, TX, USA
|
You might want to check the behavior of MQCMIT on both the mainframe and a distributed platform. It is different. My guess is that you are falling into one of these differences.
For what it is worth, the basic difference is in regard to what to do with uncommitted units of work when you MQDISC. |
|
Back to top |
|
 |
gayathri |
Posted: Thu Jul 14, 2005 4:25 am Post subject: |
|
|
Apprentice
Joined: 07 Jun 2005 Posts: 36
|
Hi,
Would you please tell me the steps that needs to be followed in COBOL to
prevent the messages from being lost.
Thanks,
Gayathri |
|
Back to top |
|
 |
bower5932 |
Posted: Thu Jul 14, 2005 6:07 am Post subject: |
|
|
 Jedi Knight
Joined: 27 Aug 2001 Posts: 3023 Location: Dallas, TX, USA
|
If you will put your messages and explicitly commit them, you shouldn't have any problems. I'd suggest that you take a look at the API reference for MQPUT, MQCMIT, and MQDISC to see if you are seeing the documented behavior. |
|
Back to top |
|
 |
gayathri |
Posted: Sun Jul 17, 2005 10:46 pm Post subject: |
|
|
Apprentice
Joined: 07 Jun 2005 Posts: 36
|
Hi,
I read the documentation of MQPUT. I have given the commit option.
My problem is
1) When there are no messages in the queue and we write N messages N-1 messages are getting written
2) If we have N messages in the queue and we write "X" messages there is no loss of messages. i.e all the X messages are getting written.
So when there are no (zero) messages in the queue and when we write "N" messages "N-1" messages are getting written
When we have "N" messages and when we write "X" messages all the "X" messages are getting written.
Please help me to solve this strange problem.
Thanks,
Gayathri |
|
Back to top |
|
 |
kevinf2349 |
Posted: Mon Jul 18, 2005 5:20 am Post subject: |
|
|
 Grand Master
Joined: 28 Feb 2003 Posts: 1311 Location: USA
|
Quote: |
I read the documentation of MQPUT. I have given the commit option.
|
What commit option? Do you mean the Syncpoint option?
The PUTting application is a Cobol mainframe program right? That program either needs to have the PUT message option for Syncpointing set to MQPMO_NO_SYNCPOINT, or it needs to call MQCMIT.
Quote from the APR
Quote: |
Because of these differences, an application which is intended to be portable should not allow this option to default; either MQPMO_SYNCPOINT or MQPMO_NO_SYNCPOINT should be specified explicitly. |
My experience is that if you don't code it, then on z/os it will default to SYNCPOINT.
If you want to use syncpointing then you will need to call MQCMIT before the message actually becomes visible on the queue. (or close the queue).
This, as others have tried to tell you, is normal behaviour. Get your mainframe people to check out their application to make sure everyone inderstands syncpointing and its effects.
I assure you this is not an MQ problem. It is an application issue and I strongly suspect a training issue too.  |
|
Back to top |
|
 |
gayathri |
Posted: Mon Jul 18, 2005 9:01 pm Post subject: |
|
|
Apprentice
Joined: 07 Jun 2005 Posts: 36
|
Hi,
Thanks for your detailed reply. I am relatively new to this technology and I am working with Java MQI calls.Sorry if I am troubling u guys on this. I am facing this problem for the past 2 months and unable to resolve . Am not aware of MQI's for z/OS.
We are interacting with a mainframe application.
We are unable to figure out the problem (whether problem is with the sender application or the receiver application). Sender is a mainframe application and the receiver Java application.
But when I locally installed MQ server and checked the Receiver application it was working fine.
Mainframe team also says that after "PUT" they tried o write the messages in the flat file the messages are getting written.
As the problem is with the VERY FIRST message and not with all the messages we are very much confused.
We tried SYNC_POINT+ Commit but it did not work.
I used qmanager.commit in java. |
|
Back to top |
|
 |
|