summaryrefslogtreecommitdiff
path: root/cpp/bindings/qpid
diff options
context:
space:
mode:
authorDarryl L. Pierce <mcpierce@apache.org>2014-04-29 15:46:34 +0000
committerDarryl L. Pierce <mcpierce@apache.org>2014-04-29 15:46:34 +0000
commit606f4d7eaccc8bbcb2cda6efb76f8f371b67aee1 (patch)
tree57082649d8829b68f8d52910c29cc521f1e7eb24 /cpp/bindings/qpid
parent7c658785a1e2fe4df46a2b2d7ab282b99140afca (diff)
downloadqpid-python-606f4d7eaccc8bbcb2cda6efb76f8f371b67aee1.tar.gz
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 <zkraus@redhat.com> git-svn-id: https://svn.apache.org/repos/asf/qpid/trunk/qpid@1591006 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'cpp/bindings/qpid')
-rwxr-xr-xcpp/bindings/qpid/examples/perl/hello_world.pl6
-rwxr-xr-xcpp/bindings/qpid/examples/perl/map_receiver.pl4
2 files changed, 5 insertions, 5 deletions
diff --git a/cpp/bindings/qpid/examples/perl/hello_world.pl b/cpp/bindings/qpid/examples/perl/hello_world.pl
index 6ec7d52f1f..917038f0ef 100755
--- a/cpp/bindings/qpid/examples/perl/hello_world.pl
+++ b/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/cpp/bindings/qpid/examples/perl/map_receiver.pl b/cpp/bindings/qpid/examples/perl/map_receiver.pl
index a538adf380..21b1cb09f2 100755
--- a/cpp/bindings/qpid/examples/perl/map_receiver.pl
+++ b/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 );