on exceptions, stomp logs the error and reenqueues

This commit is contained in:
Evan Prodromou 2010-01-30 13:15:17 -05:00
parent def5d56ce1
commit 4ae31f3476

View File

@ -31,7 +31,6 @@
require_once 'Stomp.php'; require_once 'Stomp.php';
require_once 'Stomp/Exception.php'; require_once 'Stomp/Exception.php';
class StompQueueManager extends QueueManager class StompQueueManager extends QueueManager
{ {
protected $servers; protected $servers;
@ -587,7 +586,15 @@ class StompQueueManager extends QueueManager
return false; return false;
} }
$ok = $handler->handle($item); // If there's an exception when handling,
// log the error and let it get requeued.
try {
$ok = $handler->handle($item);
} catch (Exception $e) {
$this->_log(LOG_ERR, "Exception on queue $queue: " . $e->getMessage());
$ok = false;
}
if (!$ok) { if (!$ok) {
$this->_log(LOG_WARNING, "Failed handling $info"); $this->_log(LOG_WARNING, "Failed handling $info");