[rabbitmq-discuss] Persistant/Semaphore

Larry Lewis larry.gooroo at gmail.com
Mon Jun 9 05:55:41 BST 2014


Send seems to work...

> <?php
> $txt = 'Hello World ';
> if( isset( $argv[1] ) )
> {
>     $txt = $argv[1];
> }
> require_once __DIR__ . '/vendor/autoload.php';
> use PhpAmqpLib\Connection\AMQPConnection;
> use PhpAmqpLib\Message\AMQPMessage;
>
> $connection = new AMQPConnection('api.dev.com', 5672, 'larry', '....');
> $channel = $connection->channel();
>
> $exchange = 'Site.Offline';
> $channel->exchange_declare( $exchange, 'x-lvc', false, true, false);
>
> $msg = new AMQPMessage( $txt );
> $channel->basic_publish( $msg, $exchange );
> echo " [x] Sent '{$txt}'\n";
>
> $channel->close();
> $connection->close();
>

But receive does not...

> <?php
>
> require_once __DIR__ . '/vendor/autoload.php';
> use PhpAmqpLib\Connection\AMQPConnection;
>
> $connection = new AMQPConnection('api.dev.com', 5672, 'larry', '.....');
> $channel = $connection->channel();
>
>
> $exchange = 'Site.Offline';
> $channel->exchange_declare( $exchange, 'x-lvc', false, true, false);
> $msg = $channel->basic_get( $exchange );
> echo " [x] Received ", $msg->body, "\n";
>
> $channel->close();
> $connection->close();
>

 Error Message basically ->  no queue 'Site.Offline'

Larry

PS: Your replies don't seem to be propagating to the google group ;-)

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.rabbitmq.com/pipermail/rabbitmq-discuss/attachments/20140608/019af231/attachment.html>


More information about the rabbitmq-discuss mailing list