0

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);
Aaron Dufour
  • 17,288
  • 1
  • 47
  • 69
Gamal Anwar
  • 49
  • 1
  • 6

0 Answers0