create a build-results exch for reduced publishing permissions

This commit is contained in:
Graham Christensen 2017-11-04 16:17:30 -04:00
parent f46670f738
commit a768636690
No known key found for this signature in database
GPG key ID: ACA1C1D120C83D5C
2 changed files with 5 additions and 1 deletions

View file

@ -81,7 +81,7 @@ function runner($msg) {
'content_type' => 'application/json', 'content_type' => 'application/json',
'delivery_mode' => AMQPMessage::DELIVERY_MODE_PERSISTENT, 'delivery_mode' => AMQPMessage::DELIVERY_MODE_PERSISTENT,
)); ));
$msg->delivery_info['channel']->basic_publish($message, '', 'build-results'); $msg->delivery_info['channel']->basic_publish($message, 'build-results');
$msg->delivery_info['channel']->basic_ack($msg->delivery_info['delivery_tag']); $msg->delivery_info['channel']->basic_ack($msg->delivery_info['delivery_tag']);
echo "finished\n"; echo "finished\n";

View file

@ -8,8 +8,12 @@ $connection = rabbitmq_conn();
$channel = $connection->channel(); $channel = $connection->channel();
$channel->basic_qos(null, 1, true); $channel->basic_qos(null, 1, true);
$channel->exchange_declare('build-jobs', 'fanout', false, true, false);
list($queueName, , ) = $channel->queue_declare('build-results', list($queueName, , ) = $channel->queue_declare('build-results',
false, true, false, false); false, true, false, false);
$channel->queue_bind($queueName, 'build-jobs');
function runner($msg) { function runner($msg) {
$body = json_decode($msg->body); $body = json_decode($msg->body);