PHP Producer Receive webhooks from GitHub, add to queue 1 2 3 4 5 6 7 8 9 10 11 12
require “vendor/autoload.php”; $input = file_get_contents(“php://input”); $data = json_decode($input, true); $rabbit = new PhpAmqpLib\Connection\AMQPStreamConnection( ‘localhost’, 5672, ‘guest’, ‘guest’); $channel = $rabbit->channel();
$channel->queue_declare(‘pushes’, false, true, false, false); $message = new PhpAmqpLib\Message\AMQPMessage( $input, [“delivery_mode” => 2]); $channel->basic_publish($message, ”, ‘pushes’); @lornajane