diff options
author | Brion Vibber <brion@pobox.com> | 2010-02-16 09:15:29 -0800 |
---|---|---|
committer | Brion Vibber <brion@pobox.com> | 2010-02-16 09:15:29 -0800 |
commit | 3d0c3f0577fb1b0a83bb65ae6439f018932c5c38 (patch) | |
tree | 4eace4a6bbc87fe20b6fd50b48264ab9d2d21c3a /lib/stompqueuemanager.php | |
parent | 8869ccc94e57a50c729aca97aaf878751b39fb3b (diff) |
Pull fix from testing branch: use new encoding funcs 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) { |