Author |
Message
|
simon.starkie |
Posted: Mon Sep 08, 2003 12:48 pm Post subject: Anyone have a COBOL Request-Reply with CorrelId sample. |
|
|
Disciple
Joined: 24 Mar 2002 Posts: 180
|
Hi,
I am looking for a sample COBOL program I can give to one of my developers who has no MQ expertise.
The ideal COBOL sample would implement a simple MQ Request-Reply model.
First, a request would be issued by using MQPUT to place the request message on a queue.
Second, the MessageId would be extracted with MQINQ from the message that was previously MQPUT.
Third, a response would be issued to MQGET using a CorrelId set to the MessageId which was previously extracted with MQINQ. This MQGET would also have a timeout.
If anyone has anything like this, I'd sure appreciate getting a copy. Other languages would also be useful except JAVA JMS or AMI (they are both quite different).
Thank you very much. |
|
Back to top |
|
 |
RogerLacroix |
Posted: Mon Sep 08, 2003 8:30 pm Post subject: |
|
|
 Jedi Knight
Joined: 15 May 2001 Posts: 3264 Location: London, ON Canada
|
A couple of items.
1) Throwing some code at a developer who does not understand MQ, may result in a poor performing application (or worst, non-functioning).
2) You do not do an MQINQ after a MQPUT to get the MessageID.
I would strongly suggest that you send your developer on a MQ programming course (even a basic 2-day programming course).
Also, after an application does a MQPUT, if you want to save the MessageID, you simple move the MQMD-MessageID to your working storage. (no API call is required)
Finally, if source code is what you want, then source code is what you get. At the top of the page is a link to mqseries.net repository. At the following link I have some client / server COBOL type programs:
www.capitalware.biz/sample_mqseries.html#cobolcode
later
Roger... _________________ Capitalware: Transforming tomorrow into today.
Connected to MQ!
Twitter |
|
Back to top |
|
 |
simon.starkie |
Posted: Tue Sep 09, 2003 5:19 am Post subject: |
|
|
Disciple
Joined: 24 Mar 2002 Posts: 180
|
Roger, thank you very much for correcting me about the MQINQ item. I was wrong. You are right. It should be easy to retrieve the MessageId after the MQPUT as you have indicated.
I'm not "throwing" code at the developer. The reality is that the developer in this case does not have any MQ experience at all and requested a sample. I was hoping to find somebody with decent Request-Reply sample in written in Cobol. I guess I was wrong about that too.
I'm just the design engineer. I don't have any budget $$$ to send developers to MQ programming courses.
If anyone out there has a decent MQ Request-Reply sample written in Cobol, I will pay a small cashg reward. Thanks. |
|
Back to top |
|
 |
RogerLacroix |
Posted: Tue Sep 09, 2003 8:53 pm Post subject: |
|
|
 Jedi Knight
Joined: 15 May 2001 Posts: 3264 Location: London, ON Canada
|
Hummm, ok.
Since you still are looking for sample code, then I take it that you did not go to my site.
Under MQ / COBOL, there are 2 programs called MQClient and MQServer (this would be requestor and replier). They are complete samples. The only thing missing from the MQServer is saving the MsgID value and then copying it to the CorrelID before the put.
Therefore, add the following 3 lines to MQServer:
Code: |
* In working storage
01 SAVED-MSGID PIC X(24).
* In section 4500 after MQGET
MOVE MQMD-MSGID TO SAVED-MSGID.
* In section 4000 before MQPUT
MOVE SAVED-MSGID TO MQMD-CORRELID. |
MQClient & MQServer is located at
http://www.capitalware.biz/sample_mqseries.html#cobolcode
later
Roger... _________________ Capitalware: Transforming tomorrow into today.
Connected to MQ!
Twitter |
|
Back to top |
|
 |
simon.starkie |
Posted: Wed Sep 10, 2003 8:22 am Post subject: Thanks. |
|
|
Disciple
Joined: 24 Mar 2002 Posts: 180
|
Thanks Roger
Where should I send the small cash reward? Please PM me. Thanks again. |
|
Back to top |
|
 |
vennela |
Posted: Wed Sep 10, 2003 8:42 am Post subject: |
|
|
 Jedi Knight
Joined: 11 Aug 2002 Posts: 4055 Location: Hyderabad, India
|
I think part of the reward should go to Brandon for running this site.  |
|
Back to top |
|
 |
RogerLacroix |
Posted: Wed Sep 10, 2003 8:40 pm Post subject: |
|
|
 Jedi Knight
Joined: 15 May 2001 Posts: 3264 Location: London, ON Canada
|
|
Back to top |
|
 |
simon.starkie |
Posted: Thu Sep 11, 2003 7:33 am Post subject: |
|
|
Disciple
Joined: 24 Mar 2002 Posts: 180
|
I have made a $25 donation to the American Red Cross.
This seemed like an appropriate thing to do this date.
Thanks again Roger. |
|
Back to top |
|
 |
|