
Fixed a few spelling errors. Removed unnecessary timeout argument from some connections. Removed on_return callback from send.pl. Modified rpc_client to allow parameter passing. Added autoflush, $|++, to allow for automated testing.
30 lines
426 B
Perl
30 lines
426 B
Perl
#!/usr/bin/perl
|
|
|
|
use strict;
|
|
use warnings;
|
|
|
|
$|++;
|
|
use Net::RabbitFoot;
|
|
|
|
my $conn = Net::RabbitFoot->new()->load_xml_spec()->connect(
|
|
host => 'localhost',
|
|
port => 5672,
|
|
user => 'guest',
|
|
pass => 'guest',
|
|
vhost => '/',
|
|
);
|
|
|
|
|
|
my $chan = $conn->open_channel();
|
|
|
|
$chan->publish(
|
|
exchange => '',
|
|
routing_key => 'hello',
|
|
body => 'Hello World!',
|
|
);
|
|
|
|
print " [x] Sent 'Hello World!'\n";
|
|
|
|
$conn->close();
|
|
|