I¹m using QPid (qpid-cpp v0.26) with Proton v0.6 with bindings for php
(PHP 5.3.10-1ubuntu3.10 with Suhosin-Patch (cli) (built: Feb 28 2014
23:14:25) and perl (This is perl 5, version 14, subversion 2 (v5.14.2)
built for x86_64-linux-gnu-thread-multi).
When I use a simple send client in php, a simple receive client in php
correctly receives the message. When I use a simple send client in Perl,
the receive client errors out with the following:
PHP Fatal error: Call to undefined function get_object() in
/usr/share/php/proton.php on line 283
Attached are the three source files (send.php, recv.php, send.pl).
OS: Linux 3.2.0-38-generic #61-Ubuntu SMP Tue Feb 19 12:18:21 UTC 2013
x86_64 x86_64 x86_64 GNU/Linux
--
CONFIDENTIALITY NOTICE:
The information contained in this communication, including attachments, is
confidential and intended only for the exclusive use of the addressee. If the
reader of this message is not the intended recipient, or the employee or agent
responsible for delivering it to the intended recipient, you are hereby
notified that any dissemination, distribution or copying of this communication
is strictly prohibited. If you have received this communication in error,
please notify us by telephone immediately. Thank you.
#!/usr/bin/php
<?php
include("proton.php");
$mess = new Messenger();
$mess->start();
$mess->subscribe("amqp://127.0.0.1/AutoEmail");
$msg = new Message();
while (true) {
$mess->recv(10);
while ($mess->incoming) {
try {
$mess->get($msg);
} catch (Exception $e) {
print "$e\n";
continue;
}
print "$msg->address, $msg->subject, $msg->body\n";
}
}
$mess->stop();
?>
#!/usr/bin/php
<?php
$AMQP_SERVER = "127.0.0.1";
$AMQP_QUEUE = "AutoEmail";
$AMQP_SUBJECT = "EMAIL";
include("proton.php");
$mess = new Messenger();
$mess->start();
$msg = new Message();
$msg->address = "amqp://" . $AMQP_SERVER . "/" . $AMQP_QUEUE;
$msg->subject = $AMQP_SUBJECT;
$msg->body = '{\n';
$msg->body .= ' Property: "EN",\n';
$msg->body .= ' Event: "CCEXP",\n';
$msg->body .= ' FirstName: "Tom",\n';
$msg->body .= ' LastName: "McDonald",\n';
$msg->body .= ' Last4Digits: "1234"\n';
$msg->body .= '}\n';
try {
$mess->put($msg);
$mess->send();
} catch (Exception $e) {
print "A failure occurred: $e\n";
throw $e;
}
print "Successfully sent: $msg->subject\n";
$mess->stop();
use strict;
use qpid_proton;
my $amqp_server = "127.0.0.1";
my $amqp_queue = "AutoEmail";
my $amqp_subject = "EMAIL";
my $reply_to = "~/replies";
my $address = "amqp://$amqp_server/$amqp_queue";
my $content = "{\n";
$content .= ' Property: "EN",' . "\n";
$content .= ' Event: "CCEXP",' . "\n";
$content .= ' FirstName: "Tom",' . "\n";
$content .= ' LastName: "McDonald",' . "\n";
$content .= ' Last4Digits: "1234"' . "\n";
$content .= "}\n";
my $messenger = new qpid::proton::Messenger();
$messenger->start;
my $message = new qpid::proton::Message();
$message->set_address($address);
$message->set_reply_to($reply_to);
$message->set_subject($amqp_subject);
$message->set_body($content);
$messenger->put($message);
eval $messenger->send;
warn $@ if $@;
$messenger->stop;