• Brion Vibber's avatar
    Fix for stuck queue messages: wrap processing in stomp transactions so our... · 6e4cad71
    Brion Vibber authored
    Fix for stuck queue messages: wrap processing in stomp transactions so our lack of an ACK if PHP dies actually triggers redelivery.
    
    Previously, messages once delivered would just get stuck in the queue seemingly forever if they never got ACKed.
    Note this could lead to partial duplication, for instance if the OMB or Twitter queue handlers die after 1/2 of the outgoing sends.
    
    Recommendations:
    * catch exceptions more aggressively within queue handlers (so only PHP fatal errors are likely to kill in the middle)
    * for processing that involves sending to multiple clients, consider a second queue similar to the XMPP output, eg for OMB:
     - first queue gets delivery list and builds message data, enqueueing it for each target address
     - second queue can handle each individual outgoing message (and attempt redelivery etc separately)
    
    This would also protect better against a recurring error preventing delivery in the second part, and could spread out any slow sends over multiple threads.
    6e4cad71
stompqueuemanager.php 12.9 KB