From 0d49f2fa419a414e1c9548001fcbde03d442f5c1 Mon Sep 17 00:00:00 2001 From: "Darryl L. Pierce" Date: Tue, 29 Apr 2014 15:46:34 +0000 Subject: QPID-5732: Perl examples getting the wrong cmdline arguments The hello_world and map_receiver examples had a one-off error when getting command line arguments. This patch points them back to the correct arguments. Contributed by Zdenek Kraus git-svn-id: https://svn.apache.org/repos/asf/qpid/trunk@1591006 13f79535-47bb-0310-9956-ffa450edef68 --- qpid/cpp/bindings/qpid/examples/perl/hello_world.pl | 6 +++--- qpid/cpp/bindings/qpid/examples/perl/map_receiver.pl | 4 ++-- 2 files changed, 5 insertions(+), 5 deletions(-) (limited to 'qpid/cpp') diff --git a/qpid/cpp/bindings/qpid/examples/perl/hello_world.pl b/qpid/cpp/bindings/qpid/examples/perl/hello_world.pl index 6ec7d52f1f..917038f0ef 100755 --- a/qpid/cpp/bindings/qpid/examples/perl/hello_world.pl +++ b/qpid/cpp/bindings/qpid/examples/perl/hello_world.pl @@ -24,8 +24,8 @@ use Data::Dumper; use qpid; my $broker = ( @ARGV > 0 ) ? $ARGV[0] : "localhost:5672"; -my $address = ( @ARGV > 1 ) ? $ARGV[0] : "amq.topic"; -my $connectionOptions = ( @ARGV > 2 ) ? $ARGV[1] : ""; +my $address = ( @ARGV > 1 ) ? $ARGV[1] : "amq.topic"; +my $connectionOptions = ( @ARGV > 2 ) ? $ARGV[2] : ""; # create a connection my $connection = new qpid::messaging::Connection( $broker, $connectionOptions ); @@ -43,7 +43,7 @@ eval { $sender->send( new qpid::messaging::Message("Hello world!") ); # receive the message, fetching it directly from the broker - my $message = $receiver->fetch(qpid::messaging::Duration::SECOND); + my $message = $receiver->fetch(qpid::messaging::Duration::SECOND, 1); # output the message content, then acknowledge it print $message->get_content() . "\n"; diff --git a/qpid/cpp/bindings/qpid/examples/perl/map_receiver.pl b/qpid/cpp/bindings/qpid/examples/perl/map_receiver.pl index a538adf380..21b1cb09f2 100755 --- a/qpid/cpp/bindings/qpid/examples/perl/map_receiver.pl +++ b/qpid/cpp/bindings/qpid/examples/perl/map_receiver.pl @@ -24,8 +24,8 @@ use Data::Dumper; use qpid; my $url = ( @ARGV > 0 ) ? $ARGV[0] : "amqp:tcp:127.0.0.1:5672"; -my $address = ( @ARGV > 1 ) ? $ARGV[0] : "message_queue; {create: always}"; -my $connectionOptions = ( @ARGV > 2 ) ? $ARGV[1] : ""; +my $address = ( @ARGV > 1 ) ? $ARGV[1] : "message_queue; {create: always}"; +my $connectionOptions = ( @ARGV > 2 ) ? $ARGV[2] : ""; # create a connection object my $connection = new qpid::messaging::Connection( $url, $connectionOptions ); -- cgit v1.2.1