]> git.mxchange.org Git - quix0rs-gnu-social.git/commitdiff
Added base64 encoding to get RMQ to work
authorabjectio <knut.erik@unlike.no>
Fri, 28 Jul 2017 10:42:21 +0000 (12:42 +0200)
committerabjectio <knut.erik@unlike.no>
Fri, 28 Jul 2017 10:42:21 +0000 (12:42 +0200)
extlib/Stomp.php
lib/stompqueuemanager.php

index b55a4aa6d901c2987524e2806f758925a6027c71..5132ea638be5c5d9b933f128d668ab54de467303 100644 (file)
@@ -324,7 +324,9 @@ class Stomp
     {
         $headers = array('ack' => 'client');
                $headers['activemq.prefetchSize'] = $this->prefetchSize;
-               if ($this->clientId != null) {
+        $headers['prefetch-count'] = '1';
+
+        if ($this->clientId != null) {
                        $headers["activemq.subcriptionName"] = $this->clientId;
                }
         if (isset($properties)) {
index 7c3af4945e2b1db7eb039a47bf1b007961a789a3..b1afe176a158d6c861ebed6b6c7ba37f8a4746e8 100644 (file)
@@ -151,7 +151,7 @@ class StompQueueManager extends QueueManager
         $envelope = array('site' => $siteNickname ? $siteNickname : common_config('site', 'nickname'),
                           'handler' => $queue,
                           'payload' => $this->encode($object));
-        $msg = serialize($envelope);
+        $msg = base64_encode(serialize($envelope));
 
         $props = array('created' => common_sql_now());
         if ($this->isPersistent($queue)) {
@@ -479,7 +479,7 @@ class StompQueueManager extends QueueManager
     protected function handleItem($frame)
     {
         $host = $this->cons[$this->defaultIdx]->getServer();
-        $message = unserialize($frame->body);
+        $message = unserialize(base64_decode($frame->body));
 
         if ($message === false) {
             $this->_log(LOG_ERR, "Can't unserialize frame: {$frame->body}");
@@ -490,7 +490,7 @@ class StompQueueManager extends QueueManager
         $site = $message['site'];
         $queue = $message['handler'];
 
-        if ($this->isDeadletter($frame, $message)) {
+        if ($this->isDeadLetter($frame, $message)) {
             $this->stats('deadletter', $queue);
                return false;
         }