Advertisement
Guest User

Untitled

a guest
May 24th, 2019
73
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 0.45 KB | None | 0 0
  1. <?php
  2. require_once('./vendor/autoload.php');
  3. use PhpAmqpLib\Connection\AMQPStreamConnection;
  4. use PhpAmqpLib\Message\AMQPMessage;
  5.  
  6. $lines = trim(fgets(STDIN));
  7. $connection = new AMQPStreamConnection('10.90.242.122', 10001, 'guest', 'guest');
  8. $channel = $connection->channel();
  9.  
  10. $channel->queue_declare('mensajes', false, false, false, false);
  11.  
  12. $msg = new AMQPMessage($lines);
  13. $channel->basic_publish($msg, '', 'mensajes');
  14.  
  15. echo "termino\n";
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement