Webhook: create an 'unknown' queue for collecting weird messages

This commit is contained in:
Graham Christensen 2018-03-05 07:39:35 -05:00
parent bb697d5375
commit 9fc13b95d2
No known key found for this signature in database
GPG key ID: ACA1C1D120C83D5C

View file

@ -142,7 +142,26 @@ try {
$connection = retry_rabbitmq_conn();
$channel = $connection->channel();
$dec = $channel->exchange_declare('github-events', 'topic', false, true, false);
$dec = $channel->exchange_declare(
'github-events',
'topic',
false, // passive
true, // durable
false // auto_delete
);
$channel->queue_declare(
'github-events-unknown',
false, // passive
true, // durable
false, // exclusive
false // auto-delete
);
$channel->queue_bind(
'github-events-unknown',
'github-events',
'unknown.*'
);
$message = new AMQPMessage(json_encode($input),
array(