diff options
author | Brion Vibber <brion@pobox.com> | 2010-03-31 12:48:24 -0700 |
---|---|---|
committer | Brion Vibber <brion@pobox.com> | 2010-03-31 12:48:24 -0700 |
commit | df9eb4164aec6d63869dee7bfd5cfddf6d831618 (patch) | |
tree | c078b097143772da34a6660039e79e470f86325a /lib/stompqueuemanager.php | |
parent | 89bb05311685d1bab404300e600f61deb954e18c (diff) | |
parent | 3ed88938b95804ecadc62ed3a5f61a0863e2ff78 (diff) |
Merge branch 'testing' of git@gitorious.org:statusnet/mainline into 0.9.x
Diffstat (limited to 'lib/stompqueuemanager.php')
-rw-r--r-- | lib/stompqueuemanager.php | 29 |
1 files changed, 17 insertions, 12 deletions
diff --git a/lib/stompqueuemanager.php b/lib/stompqueuemanager.php index 9af8b2f48..5d5c7ccfb 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(); @@ -59,11 +60,13 @@ class StompQueueManager extends QueueManager } else { $this->servers = array($server); } - $this->username = common_config('queue', 'stomp_username'); - $this->password = common_config('queue', 'stomp_password'); - $this->base = common_config('queue', 'queue_basename'); - $this->control = common_config('queue', 'control_channel'); - $this->breakout = common_config('queue', 'breakout'); + $this->username = common_config('queue', 'stomp_username'); + $this->password = common_config('queue', 'stomp_password'); + $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_transactions'); + $this->useAcks = common_config('queue', 'stomp_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); } } |