Author: mcpierce
Date: Tue Apr 29 15:46:34 2014
New Revision: 1591006

URL: http://svn.apache.org/r1591006
Log:
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 <[email protected]>

Modified:
    qpid/trunk/qpid/cpp/bindings/qpid/examples/perl/hello_world.pl
    qpid/trunk/qpid/cpp/bindings/qpid/examples/perl/map_receiver.pl

Modified: qpid/trunk/qpid/cpp/bindings/qpid/examples/perl/hello_world.pl
URL: 
http://svn.apache.org/viewvc/qpid/trunk/qpid/cpp/bindings/qpid/examples/perl/hello_world.pl?rev=1591006&r1=1591005&r2=1591006&view=diff
==============================================================================
--- qpid/trunk/qpid/cpp/bindings/qpid/examples/perl/hello_world.pl (original)
+++ qpid/trunk/qpid/cpp/bindings/qpid/examples/perl/hello_world.pl Tue Apr 29 
15:46:34 2014
@@ -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";

Modified: qpid/trunk/qpid/cpp/bindings/qpid/examples/perl/map_receiver.pl
URL: 
http://svn.apache.org/viewvc/qpid/trunk/qpid/cpp/bindings/qpid/examples/perl/map_receiver.pl?rev=1591006&r1=1591005&r2=1591006&view=diff
==============================================================================
--- qpid/trunk/qpid/cpp/bindings/qpid/examples/perl/map_receiver.pl (original)
+++ qpid/trunk/qpid/cpp/bindings/qpid/examples/perl/map_receiver.pl Tue Apr 29 
15:46:34 2014
@@ -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 );



---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to