From 63f12c48a8dd7c75093587d78a8fd557330d202e Mon Sep 17 00:00:00 2001 From: Evan Prodromou Date: Wed, 24 Jun 2009 19:17:41 -0700 Subject: make stomp server work with username and password --- lib/queuehandler.php | 15 ++++++++++++--- 1 file changed, 12 insertions(+), 3 deletions(-) (limited to 'lib/queuehandler.php') 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()); -- cgit v1.2.3-54-g00ecf