diff options
author | Brion Vibber <brion@pobox.com> | 2010-02-08 16:43:37 -0800 |
---|---|---|
committer | Brion Vibber <brion@pobox.com> | 2010-02-10 12:27:41 -0800 |
commit | 045797331c82b86e03c61f00f4db68a085688520 (patch) | |
tree | 96d31110682e81c732d8529f62b86b3bf5a0da25 /lib/stompqueuemanager.php | |
parent | c4557d4d0700c09742b9d2e002c2d2b0161558f3 (diff) |
fix up hub queueing to work w/ stomp queues
Diffstat (limited to 'lib/stompqueuemanager.php')
-rw-r--r-- | lib/stompqueuemanager.php | 26 |
1 files changed, 7 insertions, 19 deletions
diff --git a/lib/stompqueuemanager.php b/lib/stompqueuemanager.php index cc4c817d8..cd62c25bd 100644 --- a/lib/stompqueuemanager.php +++ b/lib/stompqueuemanager.php @@ -549,26 +549,14 @@ class StompQueueManager extends QueueManager } $host = $this->cons[$idx]->getServer(); - if (is_numeric($frame->body)) { - $id = intval($frame->body); - $info = "notice $id posted at {$frame->headers['created']} in queue $queue from $host"; - - $notice = Notice::staticGet('id', $id); - if (empty($notice)) { - $this->_log(LOG_WARNING, "Skipping missing $info"); - $this->ack($idx, $frame); - $this->commit($idx); - $this->begin($idx); - $this->stats('badnotice', $queue); - return false; - } - - $item = $notice; - } else { - // @fixme should we serialize, or json, or what here? - $info = "string posted at {$frame->headers['created']} in queue $queue from $host"; - $item = $frame->body; + $item = $this->decode($frame->body); + if (empty($item)) { + $this->_log(LOG_ERR, "Skipping empty or deleted item in queue $queue from $host"); + return true; } + $info = $this->logrep($item) . " posted at " . + $frame->headers['created'] . " in queue $queue from $host"; + $this->_log(LOG_DEBUG, "Dequeued $info"); $handler = $this->getHandler($queue); if (!$handler) { |