I've written the initial Perl language bindings on top of what Swig gives us in Qpid. I'm now porting the examples in cpp/bindings/qpid/examples/perl over to use the newer code but am hitting this weird problem. (code can be found here [1])
In the client/server examples, things start up nicely:
1. start a test instance of qpidd --auth=no
2. start server.pl
3. start client.pl
It's on step #3 above that I see, in the server.pl window, the following
error message:
Name cannot be null at
/home/mcpierce/Programming/Qpid/qpid/cpp/bindings/qpid/perl/qpid.pm line 666.
2012-08-02 17:11:52 [Client] warning Connection
[127.0.0.1:33410-127.0.0.1:5672] closed
In qpid.pm the code in question (line 666, how ominous) is in
qpid::Session:
656: sub create_sender {
657: my ($self) = @_;
658: my $impl = $self->{_impl};
659:
660: my $address = $_[1];
661:
662: if (ref($address) eq "qpid::Address") {
663: my $temp = $address->get_implementation();
664: $address = $temp;
665: }
666: my $send_impl = $impl->createSender($address);
667:
668: return new qpid::Sender($send_impl, $self);
669: }
And debugging this I see that indeed $address (which is an instance of
cqpid_perl::Address) in fact does *not* have a name. The sender is being
created by the following code in server.pl:
while (1) {
my $request = $receiver->fetch();
my $address = $request->get_reply_to();
if ($address) {
# RIGHT HERE
my $sender = $session->create_sender($address);
my $s = $request->get_content();
$s = uc($s);
my $response = new qpid::Message($s);
$sender->send($response);
print "Processed request: " . $request->get_content() . " -> " .
$response->get_content() . "\n";
$session->acknowledge();
}
else {
print "Error: no reply address specified for request: " .
$request->get_content() . "\n";
$session->reject($request);
}
}
I'm at a loss how, if a name is required for an address, this instance
of address is arriving without a name. Or is the Perl example outdated
and I'm missing something?
[1] https://github.com/mcpierce/Qpid/tree/Perl-language-bindings
--
Darryl L. Pierce, Sr. Software Engineer @ Red Hat, Inc.
Delivering value year after year.
Red Hat ranks #1 in value among software vendors.
http://www.redhat.com/promo/vendor/
pgpPuRzMB64I4.pgp
Description: PGP signature
