コード例 #1
0
ファイル: topic_producer.php プロジェクト: roadrunner/Thumper
<?php

require_once '../../config/config.php';
require_once '../../lib/Thumper/Producer.php';
require_once '../../lib/php-amqplib/amqp.inc';
$producer = new Producer(HOST, PORT, USER, PASS, VHOST);
$producer->setExchangeOptions(array('name' => 'logs-exchange', 'type' => 'topic'));
$producer->publish($argv[1], sprintf('%s.%s', $argv[2], $argv[3]));
コード例 #2
0
ファイル: producer.php プロジェクト: roadrunner/Thumper
<?php

require_once '../../config/config.php';
require_once '../../lib/Thumper/Producer.php';
require_once '../../lib/php-amqplib/amqp.inc';
$producer = new Producer(HOST, PORT, USER, PASS, VHOST);
$producer->setExchangeOptions(array('name' => 'hello-exchange', 'type' => 'direct'));
$producer->publish($argv[1]);
//The first argument will be the published message