summaryrefslogtreecommitdiff
path: root/lib/stompqueuemanager.php
diff options
context:
space:
mode:
authorEugene Crosser <crosser@average.org>2010-03-29 15:25:57 +0400
committerBrion Vibber <brion@pobox.com>2010-03-29 15:31:43 -0700
commitbd1363c17abf9686a6104fac7d62df3b044f87e9 (patch)
treeecea0296b6bd3945c12907d0d342a4faf9e7ecf7 /lib/stompqueuemanager.php
parent873b8328272ae9cb189477fd10e75b16d5ce050e (diff)
Make stomp queue manager work with basic servers
Signed-off-by: Eugene Crosser <crosser@average.org>
Diffstat (limited to 'lib/stompqueuemanager.php')
-rw-r--r--lib/stompqueuemanager.php19
1 files changed, 12 insertions, 7 deletions
diff --git a/lib/stompqueuemanager.php b/lib/stompqueuemanager.php
index 9af8b2f48..4d9f39791 100644
--- a/lib/stompqueuemanager.php
+++ b/lib/stompqueuemanager.php
@@ -39,7 +39,8 @@ class StompQueueManager extends QueueManager
protected $base;
protected $control;
- protected $useTransactions = true;
+ protected $useTransactions;
+ protected $useAcks;
protected $sites = array();
protected $subscriptions = array();
@@ -64,6 +65,8 @@ class StompQueueManager extends QueueManager
$this->base = common_config('queue', 'queue_basename');
$this->control = common_config('queue', 'control_channel');
$this->breakout = common_config('queue', 'breakout');
+ $this->useTransactions = !common_config('queue', 'stomp_no_transactions');
+ $this->useAcks = !common_config('queue', 'stomp_no_acks');
}
/**
@@ -703,13 +706,15 @@ class StompQueueManager extends QueueManager
protected function ack($idx, $frame)
{
- if ($this->useTransactions) {
- if (empty($this->transaction[$idx])) {
- throw new Exception("Tried to ack but not in a transaction");
+ if ($this->useAcks) {
+ if ($this->useTransactions) {
+ if (empty($this->transaction[$idx])) {
+ throw new Exception("Tried to ack but not in a transaction");
+ }
+ $this->cons[$idx]->ack($frame, $this->transaction[$idx]);
+ } else {
+ $this->cons[$idx]->ack($frame);
}
- $this->cons[$idx]->ack($frame, $this->transaction[$idx]);
- } else {
- $this->cons[$idx]->ack($frame);
}
}