
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.
35 lines
540 B
Perl
35 lines
540 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 $channel = $conn->open_channel();
|
|
|
|
$channel->declare_exchange(
|
|
exchange => 'logs',
|
|
type => 'fanout',
|
|
);
|
|
|
|
my $msg = join(' ', @ARGV) || "info: Hello World!";
|
|
|
|
$channel->publish(
|
|
exchange => 'logs',
|
|
routing_key => '',
|
|
body => $msg,
|
|
);
|
|
|
|
print " [x] Sent $msg\n";
|
|
|
|
$conn->close();
|