Details

    • Type: New Feature New Feature
    • Status: Closed
    • Priority: Major Major
    • Resolution: Fixed
    • Affects Version/s: 0.8
    • Fix Version/s: 0.10
    • Component/s: C++ Client
    • Labels:
      None
    • Environment:

      -

      Description

      As we need to use perl programs to send amqp messages but there is no perl version of qpid messaging.

      Therefore, I had written a perl api to bind with c++ qpid messaging library. This perl api for qpid messaging is developed using swig and is base on qpid 0.8.

      Please see the attached patch file.

      1. qpid_perl.patch
        24 kB
        Hao Chang Yu
      2. QPID-3009.diff
        33 kB
        Ted Ross

        Activity

        Hide
        Hao Chang Yu added a comment -

        Hi

        As per subject. You can reach me by email or mobile. for urgent issue
        related to my job.

        email: eugeneyu12@gmail.com
        mobile no: +6011 1645 1208

        Regards
        Hao

        Show
        Hao Chang Yu added a comment - Hi As per subject. You can reach me by email or mobile. for urgent issue related to my job. email: eugeneyu12@gmail.com mobile no: +6011 1645 1208 Regards Hao
        Hide
        Hao Chang Yu added a comment -

        Hi

        As per subject. You can reach me by email or mobile. for urgent issue
        related to my job.

        email: eugeneyu12@gmail.com
        mobile no: +6011 1645 1208

        Regards
        Hao

        Show
        Hao Chang Yu added a comment - Hi As per subject. You can reach me by email or mobile. for urgent issue related to my job. email: eugeneyu12@gmail.com mobile no: +6011 1645 1208 Regards Hao
        Hide
        Hao Chang Yu added a comment -

        Hi

        As per subject. You can reach me by email or mobile. for urgent issue
        related to my job.

        email: eugeneyu12@gmail.com
        mobile no: +6011 1645 1208

        Regards
        Hao

        Show
        Hao Chang Yu added a comment - Hi As per subject. You can reach me by email or mobile. for urgent issue related to my job. email: eugeneyu12@gmail.com mobile no: +6011 1645 1208 Regards Hao
        Hide
        Hao Chang Yu added a comment -

        Hi

        As per subject. You can reach me by email or mobile. for urgent issue
        related to my job.

        email: eugeneyu12@gmail.com
        mobile no: +6011 1645 1208

        Regards
        Hao

        Show
        Hao Chang Yu added a comment - Hi As per subject. You can reach me by email or mobile. for urgent issue related to my job. email: eugeneyu12@gmail.com mobile no: +6011 1645 1208 Regards Hao
        Hide
        Hao Chang Yu added a comment -

        Hi

        As per subject. You can reach me by email or mobile. for urgent issue
        related to my job.

        email: eugeneyu12@gmail.com
        mobile no: +6011 1645 1208

        Regards
        Hao

        Show
        Hao Chang Yu added a comment - Hi As per subject. You can reach me by email or mobile. for urgent issue related to my job. email: eugeneyu12@gmail.com mobile no: +6011 1645 1208 Regards Hao
        Hide
        Hao Chang Yu added a comment -

        Hi

        As per subject. You can reach me by email or mobile. for urgent issue
        related to my job.

        email: eugeneyu12@gmail.com
        mobile no: +6011 1645 1208

        Regards
        Hao

        Show
        Hao Chang Yu added a comment - Hi As per subject. You can reach me by email or mobile. for urgent issue related to my job. email: eugeneyu12@gmail.com mobile no: +6011 1645 1208 Regards Hao
        Hide
        Hao Chang Yu added a comment -

        Hi

        As per subject. You can reach me by email or mobile. for urgent issue
        related to my job.

        email: eugeneyu12@gmail.com
        mobile no: +6011 1645 1208

        Regards
        Hao

        Show
        Hao Chang Yu added a comment - Hi As per subject. You can reach me by email or mobile. for urgent issue related to my job. email: eugeneyu12@gmail.com mobile no: +6011 1645 1208 Regards Hao
        Hide
        Hao Chang Yu added a comment -

        Hi

        As per subject. You can reach me by email or mobile. for urgent issue
        related to my job.

        email: eugeneyu12@gmail.com
        mobile no: +6011 1645 1208

        Regards
        Hao

        Show
        Hao Chang Yu added a comment - Hi As per subject. You can reach me by email or mobile. for urgent issue related to my job. email: eugeneyu12@gmail.com mobile no: +6011 1645 1208 Regards Hao
        Hide
        Hao Chang Yu added a comment -

        Hi

        As per subject. You can reach me by email or mobile. for urgent issue
        related to my job.

        email: eugeneyu12@gmail.com
        mobile no: +6011 1645 1208

        Regards
        Hao

        Show
        Hao Chang Yu added a comment - Hi As per subject. You can reach me by email or mobile. for urgent issue related to my job. email: eugeneyu12@gmail.com mobile no: +6011 1645 1208 Regards Hao
        Hide
        Hao Chang Yu added a comment -

        Hi

        As per subject. You can reach me by email or mobile. for urgent issue
        related to my job.

        email: eugeneyu12@gmail.com
        mobile no: +6011 1645 1208

        Regards
        Hao

        Show
        Hao Chang Yu added a comment - Hi As per subject. You can reach me by email or mobile. for urgent issue related to my job. email: eugeneyu12@gmail.com mobile no: +6011 1645 1208 Regards Hao
        Hide
        Hao Chang Yu added a comment -

        Hi

        As per subject. You can reach me by email or mobile. for urgent issue
        related to my job.

        email: eugeneyu12@gmail.com
        mobile no: +6011 1645 1208

        Regards
        Hao

        Show
        Hao Chang Yu added a comment - Hi As per subject. You can reach me by email or mobile. for urgent issue related to my job. email: eugeneyu12@gmail.com mobile no: +6011 1645 1208 Regards Hao
        Hide
        Hao Chang Yu added a comment -

        Hi

        As per subject. You can reach me by email or mobile. for urgent issue
        related to my job.

        email: eugeneyu12@gmail.com
        mobile no: +6011 1645 1208

        Regards
        Hao

        Show
        Hao Chang Yu added a comment - Hi As per subject. You can reach me by email or mobile. for urgent issue related to my job. email: eugeneyu12@gmail.com mobile no: +6011 1645 1208 Regards Hao
        Hide
        Hao Chang Yu added a comment -

        Hi

        As per subject. You can reach me by email or mobile. for urgent issue
        related to my job.

        email: eugeneyu12@gmail.com
        mobile no: +6011 1645 1208

        Regards
        Hao

        Show
        Hao Chang Yu added a comment - Hi As per subject. You can reach me by email or mobile. for urgent issue related to my job. email: eugeneyu12@gmail.com mobile no: +6011 1645 1208 Regards Hao
        Hide
        Hao Chang Yu added a comment -

        Hi

        As per subject. You can reach me by email or mobile. for urgent issue
        related to my job.

        email: eugeneyu12@gmail.com
        mobile no: +6011 1645 1208

        Regards
        Hao

        Show
        Hao Chang Yu added a comment - Hi As per subject. You can reach me by email or mobile. for urgent issue related to my job. email: eugeneyu12@gmail.com mobile no: +6011 1645 1208 Regards Hao
        Hide
        Hao Chang Yu added a comment -

        Hi

        As per subject. You can reach me by email or mobile. for urgent issue
        related to my job.

        email: eugeneyu12@gmail.com
        mobile no: +6011 1645 1208

        Regards
        Hao

        Show
        Hao Chang Yu added a comment - Hi As per subject. You can reach me by email or mobile. for urgent issue related to my job. email: eugeneyu12@gmail.com mobile no: +6011 1645 1208 Regards Hao
        Hide
        Hao Chang Yu added a comment -

        Hi

        As per subject. You can reach me by email or mobile. for urgent issue
        related to my job.

        email: eugeneyu12@gmail.com
        mobile no: +6011 1645 1208

        Regards
        Hao

        Show
        Hao Chang Yu added a comment - Hi As per subject. You can reach me by email or mobile. for urgent issue related to my job. email: eugeneyu12@gmail.com mobile no: +6011 1645 1208 Regards Hao
        Hide
        Robbie Gemmell added a comment -

        Updating Fix-For version to 0.9 instead of 0.8

        Show
        Robbie Gemmell added a comment - Updating Fix-For version to 0.9 instead of 0.8
        Hide
        Gordon Sim added a comment -

        Oops! Sorry about that, folks! Fixed now: http://svn.apache.org/viewvc?view=revision&revision=1065832

        Show
        Gordon Sim added a comment - Oops! Sorry about that, folks! Fixed now: http://svn.apache.org/viewvc?view=revision&revision=1065832
        Hide
        Jose Pedro Oliveira added a comment -

        Gordon,

        Thanks for the update. The commit message needs a small correction though: s/python/perl/.

        /jpo

        Show
        Jose Pedro Oliveira added a comment - Gordon, Thanks for the update. The commit message needs a small correction though: s/python/perl/. /jpo
        Hide
        Gordon Sim added a comment -

        Thanks for that suggestion Jose. I've committed a change incorporating that check.

        Show
        Gordon Sim added a comment - Thanks for that suggestion Jose. I've committed a change incorporating that check.
        Hide
        Jose Pedro Oliveira added a comment -

        A much better way to check the existence of the header file perl.h is to use the perl archlib directory as the base path:

        • perl_h_pathname = "$PERL_ARCHLIB/CORE/perl.h"

        The following autoconf code should produce the desired results for PERL_INC:
        ----------
        ...
        AC_CHECK_PROG([PERL], [perl], [perl])

        if test -n "$PERL"; then
        PERL_ARCHLIB=`perl -MConfig -e 'print "$Config

        {archlib}

        ";'`
        AC_CHECK_FILE( ["$PERL_ARCHLIB/CORE/perl.h"],
        [AC_SUBST([PERL_INC], ["$PERL_ARCHLIB/CORE"])] )
        fi
        ...
        ----------

        Variable values in a Fedora 12 i386 system:
        ----------
        checking for perl... perl
        checking for "/usr/lib/perl5/5.10.0/i386-linux-thread-multi/CORE/perl.h"... yes
        **

        • PERL = perl
        • PERL_ARCHLIB = /usr/lib/perl5/5.10.0/i386-linux-thread-multi
        • PERL_INC = /usr/lib/perl5/5.10.0/i386-linux-thread-multi/CORE
          **
          ----------

        Variable values in a Fedora 13 x86_64 system:
        ----------
        checking for perl... perl
        checking for "/usr/lib64/perl5/CORE/perl.h"... yes
        **

        • PERL = perl
        • PERL_ARCHLIB = /usr/lib64/perl5
        • PERL_INC = /usr/lib64/perl5/CORE
          **
          ----------

        /jpo

        Show
        Jose Pedro Oliveira added a comment - A much better way to check the existence of the header file perl.h is to use the perl archlib directory as the base path: perl_h_pathname = "$PERL_ARCHLIB/CORE/perl.h" The following autoconf code should produce the desired results for PERL_INC: ---------- ... AC_CHECK_PROG( [PERL] , [perl] , [perl] ) if test -n "$PERL"; then PERL_ARCHLIB=`perl -MConfig -e 'print "$Config {archlib} ";'` AC_CHECK_FILE( ["$PERL_ARCHLIB/CORE/perl.h"] , [AC_SUBST( [PERL_INC] , ["$PERL_ARCHLIB/CORE"] )] ) fi ... ---------- Variable values in a Fedora 12 i386 system: ---------- checking for perl... perl checking for "/usr/lib/perl5/5.10.0/i386-linux-thread-multi/CORE/perl.h"... yes ** PERL = perl PERL_ARCHLIB = /usr/lib/perl5/5.10.0/i386-linux-thread-multi PERL_INC = /usr/lib/perl5/5.10.0/i386-linux-thread-multi/CORE ** ---------- Variable values in a Fedora 13 x86_64 system: ---------- checking for perl... perl checking for "/usr/lib64/perl5/CORE/perl.h"... yes ** PERL = perl PERL_ARCHLIB = /usr/lib64/perl5 PERL_INC = /usr/lib64/perl5/CORE ** ---------- /jpo
        Hide
        Jose Pedro Oliveira added a comment -

        Hi,

        The current configure doesn't detect the perl.h header file in x86_64 linux systems. It only appears to check under /usr/lib and not under /usr/lib64. Note: the perl header pathname in Fedora 13 x86_64 is /usr/lib64/perl5/CORE/perl.h.

        System: Fedora release 13 x86_64
        Working directory: .../qpid.svn/qpid/cpp

        Steps to reproduce the problem:
        ----------
        $ ./bootstrap
        $ ./configure
        ...
        checking for h2xs... h2xs
        checking for "$

        {exec_prefix}

        /lib/perl5/CORE/perl.h"... no
        ...
        ----------

        configure.ac revision:
        ----------
        $ svn info configure.ac
        Path: configure.ac
        Name: configure.ac
        URL: http://svn.apache.org/repos/asf/qpid/trunk/qpid/cpp/configure.ac
        Repository Root: http://svn.apache.org/repos/asf
        Repository UUID: 13f79535-47bb-0310-9956-ffa450edef68
        Revision: 1064938
        Node Kind: file
        Schedule: normal
        Last Changed Author: tross
        Last Changed Rev: 1064811
        Last Changed Date: 2011-01-28 19:11:54 +0000 (Fri, 28 Jan 2011)
        Text Last Updated: 2011-01-29 01:53:00 +0000 (Sat, 29 Jan 2011)
        Checksum: 9f0e36c43f30f3e839b0a0f1dd1634e8
        ----------

        /jpo

        Show
        Jose Pedro Oliveira added a comment - Hi, The current configure doesn't detect the perl.h header file in x86_64 linux systems. It only appears to check under /usr/lib and not under /usr/lib64. Note: the perl header pathname in Fedora 13 x86_64 is /usr/lib64/perl5/CORE/perl.h. System: Fedora release 13 x86_64 Working directory: .../qpid.svn/qpid/cpp Steps to reproduce the problem: ---------- $ ./bootstrap $ ./configure ... checking for h2xs... h2xs checking for "$ {exec_prefix} /lib/perl5/CORE/perl.h"... no ... ---------- configure.ac revision: ---------- $ svn info configure.ac Path: configure.ac Name: configure.ac URL: http://svn.apache.org/repos/asf/qpid/trunk/qpid/cpp/configure.ac Repository Root: http://svn.apache.org/repos/asf Repository UUID: 13f79535-47bb-0310-9956-ffa450edef68 Revision: 1064938 Node Kind: file Schedule: normal Last Changed Author: tross Last Changed Rev: 1064811 Last Changed Date: 2011-01-28 19:11:54 +0000 (Fri, 28 Jan 2011) Text Last Updated: 2011-01-29 01:53:00 +0000 (Sat, 29 Jan 2011) Checksum: 9f0e36c43f30f3e839b0a0f1dd1634e8 ---------- /jpo
        Hide
        Ted Ross added a comment -

        I agree with Gordon that the session-listener is a separate utility. I also agree that we should formulate a common pattern for its design that can be used in all of the various language APIs and bindings.

        Show
        Ted Ross added a comment - I agree with Gordon that the session-listener is a separate utility. I also agree that we should formulate a common pattern for its design that can be used in all of the various language APIs and bindings.
        Hide
        Gordon Sim added a comment -

        Very much agree that a thin layer adapting to more Perl-like usage is nice.

        I'd be cautious with committing to a particular for of session-listener. While you may be right that it will always be language specific, I think it needs some thought and discussion on the form it should take. I don't think it is an intrinsic part of the binding that must be provided. It is a possible added utility.

        Show
        Gordon Sim added a comment - Very much agree that a thin layer adapting to more Perl-like usage is nice. I'd be cautious with committing to a particular for of session-listener. While you may be right that it will always be language specific, I think it needs some thought and discussion on the form it should take. I don't think it is an intrinsic part of the binding that must be provided. It is a possible added utility.
        Hide
        Ted Ross added a comment -

        While I'm on the subject...

        These bindings should also include a session-listener which is optionally created (passing a Session in the constructor). It creates a thread (in the script language's threading model), and loops on Session.nextReceiver(), invoking a callback when a message is received.

        Even when a session-listener is provided in C++ (isn't there yet), this function should be provided in the wrapping script language. Invoking callbacks up through the wrapper is not practical to do and there may be incompatibilities between the C++ thread model and the wrapping language's thread model.

        -Ted

        Show
        Ted Ross added a comment - While I'm on the subject... These bindings should also include a session-listener which is optionally created (passing a Session in the constructor). It creates a thread (in the script language's threading model), and loops on Session.nextReceiver(), invoking a callback when a message is received. Even when a session-listener is provided in C++ (isn't there yet), this function should be provided in the wrapping script language. Invoking callbacks up through the wrapper is not practical to do and there may be incompatibilities between the C++ thread model and the wrapping language's thread model. -Ted
        Hide
        Ted Ross added a comment -

        I have a comment that pertains to the structure of these Swig-generated bindings and the examples in this contribution:

        The Swig-generated binding is called "cqpid" which denotes a mechanical binding of the C++ API in the target scripting language. It is identical to the C++ API in class and method names and style. This is not necessarily appropriate for the scripting language which may typically use another style.

        I would suggest that a thin layer of Perl be added that defines a module called "qpid" (without the 'c'). This layer can provide a more Perl-like interface that adheres to Perl coding conventions and provides whatever self-documentation/annotation that is available for Perl.

        An example of a difference can be seen in the map-message examples. In C++ the following pattern is used:

        my $message = new cqpid::Message();
        my $content =

        { ... }

        ;
        cqpid::encode($content, $message);
        $sender->send($message);

        However, in Perl, it might be nicer to be able to do something like:

        my $message = new qpid::Message(

        {...});
        $sender->send($message);

        or even:

        $sender->send({...}

        );

        Comments welcome.

        -Ted

        Show
        Ted Ross added a comment - I have a comment that pertains to the structure of these Swig-generated bindings and the examples in this contribution: The Swig-generated binding is called "cqpid" which denotes a mechanical binding of the C++ API in the target scripting language. It is identical to the C++ API in class and method names and style. This is not necessarily appropriate for the scripting language which may typically use another style. I would suggest that a thin layer of Perl be added that defines a module called "qpid" (without the 'c'). This layer can provide a more Perl-like interface that adheres to Perl coding conventions and provides whatever self-documentation/annotation that is available for Perl. An example of a difference can be seen in the map-message examples. In C++ the following pattern is used: my $message = new cqpid::Message(); my $content = { ... } ; cqpid::encode($content, $message); $sender->send($message); However, in Perl, it might be nicer to be able to do something like: my $message = new qpid::Message( {...}); $sender->send($message); or even: $sender->send({...} ); Comments welcome. -Ted
        Hide
        Ted Ross added a comment -

        Complete patch:

        1) Original content
        2) Automake additions
        3) Added License text to examples

        Show
        Ted Ross added a comment - Complete patch: 1) Original content 2) Automake additions 3) Added License text to examples
        Hide
        Ted Ross added a comment -

        Here is a cut at the autoconf/automake support for building this binding.

        Show
        Ted Ross added a comment - Here is a cut at the autoconf/automake support for building this binding.
        Hide
        Hao Chang Yu added a comment -

        patch file for perl qpid messaging.

        Show
        Hao Chang Yu added a comment - patch file for perl qpid messaging.
        Hide
        Hao Chang Yu added a comment -

        I haven't create a makefile for it as I am not very familiar with autoconf/automake. That will be great if you guys can help me to make one.

        Below are the commands which I use to compile the codes:

        swig -perl5 -c++ -w362,401 -I/usr/local/include -o cqpid.cpp perl.i

        g++ -c -fpic -D_REENTRANT -D_GNU_SOURCE -fno-strict-aliasing -pipe -fstack-protector -isystem /usr/local/include -D_LARGEFILE_SOURCE
        -D_FILE_OFFSET_BITS=64 -I/usr/lib64/perl5/CORE cqpid.cpp

        g++ -shared cqpid.o -lqpidmessaging -lqpidtypes -o cqpid.so

        Show
        Hao Chang Yu added a comment - I haven't create a makefile for it as I am not very familiar with autoconf/automake. That will be great if you guys can help me to make one. Below are the commands which I use to compile the codes: swig -perl5 -c++ -w362,401 -I/usr/local/include -o cqpid.cpp perl.i g++ -c -fpic -D_REENTRANT -D_GNU_SOURCE -fno-strict-aliasing -pipe -fstack-protector -isystem /usr/local/include -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64 -I/usr/lib64/perl5/CORE cqpid.cpp g++ -shared cqpid.o -lqpidmessaging -lqpidtypes -o cqpid.so

          People

          • Assignee:
            Ted Ross
            Reporter:
            Hao Chang Yu
          • Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved:

              Development