RabbitMQ Multi channels

177 Views Asked by At

I have developed a PHP application using RabbitMQ and NodeJs. Then i made a copy of that application on the same server. The problem is that sending any message in any application, the other application is listining also, so i want every application to work on isolated channel.

Send.php

$channel = $connection->channel();
$channel->exchange_declare($job, 'fanout', false, false, false);
$msg = new AMQPMessage($jsonData, array( 'delivery_mode' => 2 ));
$channel->basic_publish($msg, $job);

Receive.php

$channel = $connection->channel();
$channel->exchange_declare($job, 'fanout', false, false, false);
list($queue_name,, ) = $channel->queue_declare("", false, false, true, false);
$channel->queue_bind($queue_name, $job);
0

There are 0 best solutions below