diff options
author | Sarven Capadisli <csarven@controlyourself.ca> | 2009-06-25 06:57:00 +0000 |
---|---|---|
committer | Sarven Capadisli <csarven@controlyourself.ca> | 2009-06-25 06:57:00 +0000 |
commit | e872ca5bfa01f8f3c0142d7a618d8069690d6a23 (patch) | |
tree | 35b98251728b88155ad69c4dc84b8eb1f22d32bc /lib/queuehandler.php | |
parent | fcb43dd7112740284d2c1cb2708ac6a8a135cbdb (diff) | |
parent | 246013d984245737983054abf7496aa3879cfc58 (diff) |
Merge branch '0.8.x' of git@gitorious.org:laconica/dev into 0.8.x
Diffstat (limited to 'lib/queuehandler.php')
-rw-r--r-- | lib/queuehandler.php | 15 |
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()); |