In the resend procedure of recover_33 you have two message handles, the one that was saved by the Send OK procedure, usually in a global called ob_save, and the one returned by the engine ($mh). Normally the message handle in $ob_save is copied to a variable called my_mh and the ob_save variable is then cleared.
In the past we have always said that you should KILL one of these and PROTO the other and it did not make any difference which since both handles contain the same message.
We have found if you PROTO $mh, it will not maintain the STATE 14 so if the thread is shut down following a reeend and no acknowledgement is received, the message is lost. However, if you PROTO the $my_mh message handle it will maintain the State 14 and will be recoverable.
I suggest you check the resend procedure of your recover_33 procs and insure you are resending (PROTO) the saved message handle and not the one returned by the engine. Hopefully this will be fixed in upcoming versions. Also in 5.7 recover_33 will be built into the engine.
We have also found that there are so many versions of the recover_33 procs that it is hard to keep up with them. Therefore, I will upload a copy of recover_33.tcl to the scripts area of this forum and that will be the only version we recommend or support.
I will also upload an updated version of the generic application to return an HL7 ACK named hl7Raw_ack.tcl. This version will support both multiserver and non-multiserver interfaces.
Now, to dispel old wives tales
There has been no change to the way Cloverleaf does recovery since version 3.3, thus the name recover_33. Prior to version 3.3, we had to do recovery different and there was a set of procedures named recover that did that. When version 3.3 was released we named the new procedures recover_33 to tell the difference. It has not changed since then!
Anyone that tells you that you need recover_38, recover_53 or whatever is pumping smoke up your butt 😀