View previous topic :: View next topic
|
Author |
Message |
mohitsaini Warnings : 1 New User
Joined: 15 May 2006 Posts: 92
|
|
|
|
Hi All,
I am working on a MQ/CICS Mainframe environment.
As per my requirement, I am receiving messages (XML format) on MQ which then triggers one CICS transaction ETTT (for example). Now this transaction/program cannot proceed with processing the message if a flag in some other DB2 table is set to Y. Program processing has to wait until that flag is set back to N. N is like a green signal. Y is like a red signal.
Now this flag could be set to Y for several minutes and for that many minutes I do not want to make my cobol program wait/sleep.
I was thinking of two options but not sure how to make it working:
1. Start with a non destructive read (with browsing mode)
Problem with this is that if that Db2 table flag is set to N already then how do I convert this to destructive read.
2. Start with normal MQGET and if I see DB2 flag as Y then write the message to a temp table and exit the program. But there I am not sure what will happen to the rest of the message which are in the queue.
Any thoughts on this. If you want I can elaborate further.
Thanks,
Mohit |
|
Back to top |
|
|
Garry Carroll
Senior Member
Joined: 08 May 2006 Posts: 1202 Location: Dublin, Ireland
|
|
|
|
Quote: |
1. Start with a non destructive read (with browsing mode)
Problem with this is that if that Db2 table flag is set to N already then how do I convert this to destructive read. |
All you would need to do is ENDBROWSE and then issue the destructive MQGET specifying the relevant MSGID. However, this is not a good approach to your situation because, if you don't issue a destructive MQGET and terminate your task, this message will then be at the head of the queue when the next message arrives to generates a trigger. How do you ensure that the correct message is then retrieved? I don't see a field in the Trigger Message that you can use for this.
Quote: |
2. Start with normal MQGET and if I see DB2 flag as Y then write the message to a temp table and exit the program. But there I am not sure what will happen to the rest of the message which are in the queue.
|
This looks more like the way to go. There is no problem with the rest of the messages which are in the queue as they will be processed when triggered (I assume you're using TRIGGER=EVERY and that messages are individual ?). You need some mechanism, though, to process the messages from the temporary table to the DB2 table when the flag gets set to 'N'.
Garry. |
|
Back to top |
|
|
|