Katie Horn has submitted this change and it was merged.

Change subject: Do not always use convert_string_expressions with STOMP
......................................................................


Do not always use convert_string_expressions with STOMP

with ActiveMQ >= 5.6 convert_string_expressions is no longer needed
and causes STOMP exceptions to be thrown. :(

Change-Id: I61ea40997c7bd48c088f655151712244d135ff0a
---
M Core/DataStores/StompDataStore.php
M config_defaults.php
2 files changed, 11 insertions(+), 2 deletions(-)

Approvals:
  Katie Horn: Verified; Looks good to me, approved



diff --git a/Core/DataStores/StompDataStore.php 
b/Core/DataStores/StompDataStore.php
index cefb446..076bae1 100644
--- a/Core/DataStores/StompDataStore.php
+++ b/Core/DataStores/StompDataStore.php
@@ -8,6 +8,9 @@
        /** @var bool If true, this class is using a PHP STOMP library, if 
false it is using the PEAR one */
        protected $usingPhpStomp = false;
 
+       /** @var bool If true will use the convert_string_expressions: selector 
term (For ActiveMQ < 5.6 */
+       protected $convertStringExpressions = false;
+
        /** @var \Stomp Connection object to STOMP server */
        protected $stompObj = null;
 
@@ -60,6 +63,7 @@
                $this->uri = $c->val( 'data-store/stomp/uri' );
                $this->timeout = $c->val( 'data-store/stomp/timeout' );
                $this->refreshConnection = $c->val( 
'data-store/stomp/refresh-connection' );
+               $this->convertStringExpressions = $c->val( 
'data-store/stomp/convert-string-expressions' );
 
                // Start the connection
                $this->createBackingObject();
@@ -363,8 +367,12 @@
                        $value = $groups[3];
 
                        if ( is_numeric( $value ) === true ) {
-                               // See http://activemq.apache.org/selectors.html
-                               $key = "convert_string_expressions:{$key}";
+                               if ( $this->convertStringExpressions ) {
+                                       // See 
http://activemq.apache.org/selectors.html
+                                       $key = 
"convert_string_expressions:{$key}";
+                               } else {
+                                       // Nothing, the key is already in 
canonical form
+                               }
                        } else {
                                $value = trim( $value, " '\"" );
                                $value = "'{$value}'";
diff --git a/config_defaults.php b/config_defaults.php
index b3a2e08..2d21317 100644
--- a/config_defaults.php
+++ b/config_defaults.php
@@ -36,6 +36,7 @@
                                'uri' => 'tcp://localhost:61613',
                                'timeout' => 1,
                                'refresh-connection' => false,
+                               'convert-string-expressions' => false,
 
                                'queues' => array(
                                        'limbo' => '/queue/limbo',

-- 
To view, visit https://gerrit.wikimedia.org/r/92551
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings

Gerrit-MessageType: merged
Gerrit-Change-Id: I61ea40997c7bd48c088f655151712244d135ff0a
Gerrit-PatchSet: 1
Gerrit-Project: wikimedia/fundraising/SmashPig
Gerrit-Branch: master
Gerrit-Owner: Mwalker <[email protected]>
Gerrit-Reviewer: Adamw <[email protected]>
Gerrit-Reviewer: Katie Horn <[email protected]>

_______________________________________________
MediaWiki-commits mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits

Reply via email to