There is no property to restore, so this line is incorrect:
$msgOut->Recoverable = true;
According to the documentation of the MSMQMessage class, the property name must be "Delivery", and the value is MQMSG_DELIVERY_RECOVERABLE :
public const int MQMSG_DELIVERY_EXPRESS = 0; public const int MQMSG_DELIVERY_RECOVERABLE = 1;
You can send the recovered message in this way:
$msgOut->Body = $this->getBody(); $msgOut->Label = $this->getLabel(); $msgOut->Delivery = 1; $msgOut->Send($msgQueue);
source share