Adamw has uploaded a new change for review.

  https://gerrit.wikimedia.org/r/86279


Change subject: fix dequeue by selector
......................................................................

fix dequeue by selector

Change-Id: I691533bf91f7243db93d39679ec9cf654de51b31
---
M sites/all/modules/wmf_common/Queue.php
M sites/all/modules/wmf_common/wmf_common.module
2 files changed, 5 insertions(+), 2 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/wikimedia/fundraising/crm 
refs/changes/79/86279/1

diff --git a/sites/all/modules/wmf_common/Queue.php 
b/sites/all/modules/wmf_common/Queue.php
index c91eed6..e5fe9d7 100644
--- a/sites/all/modules/wmf_common/Queue.php
+++ b/sites/all/modules/wmf_common/Queue.php
@@ -90,7 +90,7 @@
         $con = $this->getFreshConnection();
         $properties = array(
             'ack' => 'client',
-            'correlation-id' => $correlationId,
+            'selector' => "JMSCorrelationID='{$correlationId}'",
         );
         $con->subscribe( $queue, $properties );
 
diff --git a/sites/all/modules/wmf_common/wmf_common.module 
b/sites/all/modules/wmf_common/wmf_common.module
index 692c853..643f44b 100644
--- a/sites/all/modules/wmf_common/wmf_common.module
+++ b/sites/all/modules/wmf_common/wmf_common.module
@@ -172,6 +172,9 @@
 function wmf_common_queue_item_form( $form, &$form_state, $queue, 
$correlationId ) {
   $q = queue2civicrm_stomp();
 
+  $queue = preg_replace( '/[^-a-z]/', '', $queue );
+  $correlationId = preg_replace( '/[^-a-z0-9]/', '', $correlationId );
+
   $msg = $q->getByCorrelationId( $queue, $correlationId );
   $msg = json_decode( $msg->body, TRUE );
 
@@ -182,7 +185,7 @@
     );
   }
   if ( !empty( $msg['original'] ) ) {
-    $body = json_decode( $msg['original'], TRUE );
+    $body = $msg['original'];
   } else {
     $body = $msg;
   }

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: I691533bf91f7243db93d39679ec9cf654de51b31
Gerrit-PatchSet: 1
Gerrit-Project: wikimedia/fundraising/crm
Gerrit-Branch: master
Gerrit-Owner: Adamw <[email protected]>

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

Reply via email to