Exception handling in queue handler logic

This commit is contained in:
Mikael Nordfeldth
2016-01-14 02:04:15 +01:00
parent cf7d2f4d0f
commit f699ffeb8a
5 changed files with 81 additions and 41 deletions

View File

@@ -509,15 +509,13 @@ class StompQueueManager extends QueueManager
$frame->headers['created'] . " in queue $queue from $host";
$this->_log(LOG_DEBUG, "Dequeued $info");
$handler = $this->getHandler($queue);
if (!$handler) {
try {
$handler = $this->getHandler($queue);
$ok = $handler->handle($item);
} catch (NoQueueHandlerException $e) {
$this->_log(LOG_ERR, "Missing handler class; skipping $info");
$this->stats('badhandler', $queue);
return false;
}
try {
$ok = $handler->handle($item);
} catch (Exception $e) {
$this->_log(LOG_ERR, "Exception on queue $queue: " . $e->getMessage());
$ok = false;