summaryrefslogtreecommitdiff
path: root/lib/queuehandler.php
diff options
context:
space:
mode:
authorEvan Prodromou <evan@controlyourself.ca>2009-06-24 19:17:41 -0700
committerEvan Prodromou <evan@controlyourself.ca>2009-06-24 19:17:41 -0700
commit63f12c48a8dd7c75093587d78a8fd557330d202e (patch)
tree62346ec32145d1ef798cd57fd860cea5e5e0c818 /lib/queuehandler.php
parent5f1b97e2add1b525401deef290ba29937135d073 (diff)
make stomp server work with username and password
Diffstat (limited to 'lib/queuehandler.php')
-rw-r--r--lib/queuehandler.php15
1 files changed, 12 insertions, 3 deletions
diff --git a/lib/queuehandler.php b/lib/queuehandler.php
index d5e0150d9..ae403c65e 100644
--- a/lib/queuehandler.php
+++ b/lib/queuehandler.php
@@ -112,12 +112,21 @@ class QueueHandler extends Daemon
}
function stomp_dispatch() {
- require("Stomp.php");
- $con = new Stomp(common_config('queue','stomp_server'));
- if (!$con->connect()) {
+
+ // use an external message queue system via STOMP
+ require_once("Stomp.php");
+
+ $server = common_config('queue','stomp_server');
+ $username = common_config('queue', 'stomp_username');
+ $password = common_config('queue', 'stomp_password');
+
+ $con = new Stomp($server);
+
+ if (!$con->connect($username, $password)) {
$this->log(LOG_ERR, 'Failed to connect to queue server');
return false;
}
+
$queue_basename = common_config('queue','queue_basename');
// subscribe to the relevant queue (format: basename-transport)
$con->subscribe('/queue/'.$queue_basename.'-'.$this->transport());