Author |
Message
|
mpalmer |
Posted: Tue Mar 26, 2002 10:58 am Post subject: |
|
|
Novice
Joined: 25 Mar 2002 Posts: 24 Location: New Jersey, USA
|
A developer created a C program on AIX (IBM RS6000) to connect to a queue manager, open a queue and put a message. After the MQPUT, he then added a loop to keep the program running for five minutes. While the program was running, he entered cntl-C to abort the program. The 1 message remained on the queue. I expected the message to be recalled from the queue if the program aborted. How do I write a program to put to a queue, but, if the program abends, back out all messages? Else, how does one recover from this situation? On restart, how would you know where in the input file to begin sending messages if say there were 500 messages in the input file and the first 100 got put to the queue? It seems to me that the easiest restart would be to back out all messages put the first time, and resend all messages on restart. Please advise me on design. Thanks much. |
|
Back to top |
|
 |
mqonnet |
Posted: Tue Mar 26, 2002 11:08 am Post subject: |
|
|
 Grand Master
Joined: 18 Feb 2002 Posts: 1114 Location: Boston, Ma, Usa.
|
In the event of application failure, i would think that on all O/S, the messages are NOT COMMITTED(I may miss out somethin here). I dont remember if there is an Implicit commit or not(surely would like to get views on this one).
As for why you see the currdepth. That is seen even if the messages are not committed. Just looking at the currdepth does not mean that the messages put by the app were committed before the app died. You should try and browse the messages. If you are able to do so, then the messages are understood to have been committed. But otherwise, it means that those are just the messages the app was trying to put within syncpoint and since it died without issuing explicity commit, the messages are not committed and hence not readable/recoverable.
Cheers.
Kumar
_________________ IBM Certified WebSphere MQ V5.3 Developer
IBM Certified WebSphere MQ V5.3 Solution Designer
IBM Certified WebSphere MQ V5.3 System Administrator |
|
Back to top |
|
 |
mpalmer |
Posted: Tue Mar 26, 2002 11:19 am Post subject: |
|
|
Novice
Joined: 25 Mar 2002 Posts: 24 Location: New Jersey, USA
|
I looked at the contents of the queue thru MQExplorer. I was able to view the message. This tells me that the message WAS committed even though the program was aborted. Not what I want to happen. |
|
Back to top |
|
 |
mqonnet |
Posted: Tue Mar 26, 2002 11:28 am Post subject: |
|
|
 Grand Master
Joined: 18 Feb 2002 Posts: 1114 Location: Boston, Ma, Usa.
|
|
Back to top |
|
 |
mpalmer |
Posted: Tue Mar 26, 2002 11:36 am Post subject: |
|
|
Novice
Joined: 25 Mar 2002 Posts: 24 Location: New Jersey, USA
|
I cannot access the listed web site from my office (security block). I will try at home, or can you email it to me? |
|
Back to top |
|
 |
mqonnet |
Posted: Tue Mar 26, 2002 11:46 am Post subject: |
|
|
 Grand Master
Joined: 18 Feb 2002 Posts: 1114 Location: Boston, Ma, Usa.
|
|
Back to top |
|
 |
PeterPotkay |
Posted: Tue Mar 26, 2002 1:16 pm Post subject: |
|
|
 Poobah
Joined: 15 May 2001 Posts: 7722
|
You did not say anywhere that you specified the Syncpoint option on the PUT call. If you put with no syncpoint, then the behavior you are seeing is correct. If syncpoint is yes, then every message that you put since the last checkpoint will be removed from the queue in the event of an abnormal termination or MQBACK call.
_________________ Peter Potkay
Keep Calm and MQ On |
|
Back to top |
|
 |
mqonnet |
Posted: Tue Mar 26, 2002 2:02 pm Post subject: |
|
|
 Grand Master
Joined: 18 Feb 2002 Posts: 1114 Location: Boston, Ma, Usa.
|
If syncpoint is yes, then every message that you put since the last checkpoint will be removed from the queue in the event of an abnormal termination or MQBACK call.
---And which means that all the messages put prior to this state would be committed(implicit commit) and be available. But those which have not been checkpointed would be pulled off the queue.
Cheers.
Kumar
_________________ IBM Certified WebSphere MQ V5.3 Developer
IBM Certified WebSphere MQ V5.3 Solution Designer
IBM Certified WebSphere MQ V5.3 System Administrator |
|
Back to top |
|
 |
mpalmer |
Posted: Wed Mar 27, 2002 6:11 am Post subject: |
|
|
Novice
Joined: 25 Mar 2002 Posts: 24 Location: New Jersey, USA
|
Thanks for your help. I am looking into how to set this option. I will try to find an example on this site. If anyone has an example of how to do this in a C program, please let me know. |
|
Back to top |
|
 |
bduncan |
Posted: Wed Mar 27, 2002 2:48 pm Post subject: |
|
|
Padawan
Joined: 11 Apr 2001 Posts: 1554 Location: Silicon Valley
|
|
Back to top |
|
 |
|