Perl-Stomp Packages Feedback

classic Classic list List threaded Threaded
6 messages Options
Reply | Threaded
Open this post in threaded view
|

Perl-Stomp Packages Feedback

sileshi
I have two Perl Stomp packages I have looked into:
1. Stomp-0.02 by Ian Holsman
2. Perl Stomp Interface by Allen Willis

These are two different implementations of the Stomp prorocols.
Which one is the latest? In both of them, I be able to do
synschronous message send and receive when both the send
and the receiver are Perl clients. But when I mix Java JMS client
to publish to that same queue, the perl client did not receive
the message at by Stomp-0.02, but the Perl Stomp Interface
retuns an empty message with message trace:
$VAR1 = bless( {
                 'headers' => {},
                 'message' => undef,
                 'command' => undef
               }, 'Stomp::Response' );


Besides this minor problem they are reasonbly okay. They both need
one important aspect of the Messaging domain: Asynchronous message
delivery.
It would be very valuable and essential to have Asynchronous Message
delivery mechanism to really build publish and subscribe messaging.
This does not require a change to protocol itself, rather it requires
for client to register a message listener or callback method so that
it could be notified when a message arrives.
Reply | Threaded
Open this post in threaded view
|

Re: Perl-Stomp Packages Feedback

Alan Willis

Thanks for taking a look at this sileshi, I haven't had as much time as I would have liked to perform further testing.
Can you send me a copy of the code to the perl client you are using to receive messages from the Java JMS client?

As for async message delivery, I need a bit more time to think about how this should be done.  I'm very open to all suggestions.
I wasn't aware that anyone was looking at this, I'll take some time to work on this during this upcoming weekend.

thanks,
-alan

sileshi wrote:
[stomp-dev] Perl-Stomp Packages Feedback

I have two Perl Stomp packages I have looked into:
1. Stomp-0.02 by Ian Holsman
2. Perl Stomp Interface by Allen Willis

These are two different implementations of the Stomp prorocols.
Which one is the latest? In both of them, I be able to do
synschronous message send and receive when both the send
and the receiver are Perl clients. But when I mix Java JMS client
to publish to that same queue, the perl client did not receive
the message at by Stomp-0.02, but the Perl Stomp Interface
retuns an empty message with message trace:
$VAR1 = bless( {
                 'headers' => {},
                 'message' => undef,
                 'command' => undef
               }, 'Stomp::Response' );


Besides this minor problem they are reasonbly okay. They both need
one important aspect of the Messaging domain: Asynchronous message
delivery.
It would be very valuable and essential to have Asynchronous Message
delivery mechanism to really build publish and subscribe messaging.
This does not require a change to protocol itself, rather it requires
for client to register a message listener or callback method so that
it could be notified when a message arrives.

--
View this message in context: http://www.nabble.com/Perl-Stomp-Packages-Feedback-tf2353711.html#a6555651
Sent from the stomp - dev mailing list archive at Nabble.com.


---------------------------------------------------------------------
To unsubscribe from this list please visit:

    http://xircles.codehaus.org/manage_email



-- 
Alan Willis
Ticketmaster
8800 Sunset Blvd, West Hollywood, CA 90069
Office: 310.360.2522 Mobile: 310.499.6358
Reply | Threaded
Open this post in threaded view
|

Re: Perl-Stomp Packages Feedback

sileshi
As you requested for testcases I used, I have attached a couple of files:


1. subscriber.pl - subscribes to a topic
subscriber.pl

2. publisher.pl - publishes to a topic

publisher.pl

Just run the subscriber first and then the publisher. Here is the error trace
of the Java client publish result:
$VAR1 = bless( {
                 'headers' => {},
                 'message' => undef,
                 'command' => undef
               }, 'Stomp::Response' );
send: Cannot determine peer address at Stomp/Client.pm line 65

That is _recv() method of send() method call:

sub _transmit {

        my ( $self, $request ) = @_;
    die "Not a valid request object\n" unless ref $request eq 'Stomp::Request';

    if ( _check_dest($request->destination) and $request->command ne 'ACK' ) {
        $request->set_ack;
    }

    $self->{'skt'}->send( $request->content );
}




Alan Willis wrote
Thanks for taking a look at this sileshi, I haven't had as much time as
I would have liked to perform further testing.
Can you send me a copy of the code to the perl client you are using to
receive messages from the Java JMS client?

As for async message delivery, I need a bit more time to think about how
this should be done.  I'm very open to all suggestions.
I wasn't aware that anyone was looking at this, I'll take some time to
work on this during this upcoming weekend.

thanks,
-alan

sileshi wrote:
>
> I have two Perl Stomp packages I have looked into:
> 1. Stomp-0.02 by Ian Holsman
> 2. Perl Stomp Interface by Allen Willis
>
> These are two different implementations of the Stomp prorocols.
> Which one is the latest? In both of them, I be able to do
> synschronous message send and receive when both the send
> and the receiver are Perl clients. But when I mix Java JMS client
> to publish to that same queue, the perl client did not receive
> the message at by Stomp-0.02, but the Perl Stomp Interface
> retuns an empty message with message trace:
> $VAR1 = bless( {
>                  'headers' => {},
>                  'message' => undef,
>                  'command' => undef
>                }, 'Stomp::Response' );
>
>
> Besides this minor problem they are reasonbly okay. They both need
> one important aspect of the Messaging domain: Asynchronous message
> delivery.
> It would be very valuable and essential to have Asynchronous Message
> delivery mechanism to really build publish and subscribe messaging.
> This does not require a change to protocol itself, rather it requires
> for client to register a message listener or callback method so that
> it could be notified when a message arrives.
>
> --
> View this message in context:
> http://www.nabble.com/Perl-Stomp-Packages-Feedback-tf2353711.html#a6555651 
>
> Sent from the stomp - dev mailing list archive at Nabble.com.
>
>
> ---------------------------------------------------------------------
> To unsubscribe from this list please visit:
>
>     http://xircles.codehaus.org/manage_email
>


--
Alan Willis
Ticketmaster
8800 Sunset Blvd, West Hollywood, CA 90069
Office: 310.360.2522 Mobile: 310.499.6358
Reply | Threaded
Open this post in threaded view
|

C Stomp error handling enhancement

wayne.x.liu

I ran into some problems using stomp, but found it hard to know what the errors were.  All the errors were reported as 20014 (APR_EGENERAL).  Thus, I changed the code to report more specifically what the problem is.

This is much more useful to me. Can this be put into the code?

Thanks,

Wayne


=== stomp.c
==================================================================
--- stomp.c     (revision 2790)
+++ stomp.c     (local)
@@ -76,7 +76,7 @@
        stomp_connection *connection = *connection_ref;
   
    if( connection_ref == NULL || *connection_ref==NULL )
-      return APR_EGENERAL;
+      return APR_OS_START_USERERR+1;
   
        result = APR_SUCCESS;  
    rc = apr_socket_shutdown(connection->socket, APR_SHUTDOWN_WRITE);  
@@ -160,7 +160,7 @@
             apr_socket_recv(connection->socket, endline, &length);
             CHECK_SUCCESS;
             if( endline[0] != '\n' ) {
-               return APR_EGENERAL;
+               return APR_OS_START_USERERR+2;
             }
             break;
          }
@@ -279,7 +279,7 @@
       p = strstr(buffer,"\n");
       if( p == NULL ) {
          // Expected at least 1 \n to delimit the command.
-         return APR_EGENERAL;
+         return APR_OS_START_USERERR+3;
       }
 
       // Null terminate the command.
@@ -293,7 +293,7 @@
          p = strstr(buffer,"\n");
          if( p == NULL ) {
             // Expected at least 1 more \n to delimit the start of the body
-            return APR_EGENERAL;
+            return APR_OS_START_USERERR+4;
          }
         
          l = p-buffer;
@@ -314,7 +314,7 @@
             p2 = strstr(buffer,":");
             if( p2 == NULL ) {
                // Expected at 1 : to delimit the key from the value.
-               return APR_EGENERAL;
+               return APR_OS_START_USERERR+5;
             }
             
             // Null terminate the key





This transmission may contain information that is privileged,
confidential, legally privileged, and/or exempt from disclosure
under applicable law. If you are not the intended recipient, you
are hereby notified that any disclosure, copying, distribution, or
use of the information contained herein (including any reliance
thereon) is STRICTLY PROHIBITED. Although this transmission and
any attachments are believed to be free of any virus or other
defect that might affect any computer system into which it is
received and opened, it is the responsibility of the recipient to
ensure that it is virus free and no responsibility is accepted by
JPMorgan Chase & Co., its subsidiaries and affiliates, as
applicable, for any loss or damage arising in any way from its use.
If you received this transmission in error, please immediately
contact the sender and destroy the material in its entirety,
whether in electronic or hard copy format. Thank you.

Reply | Threaded
Open this post in threaded view
|

Re: Perl-Stomp Packages Feedback

sileshi
In reply to this post by sileshi
Alan, my suggestion for implementing async message delivery is to use a solid
foundation at the bottom. I'm not a perl guru(haven't used it for 6 years).
I believe the Perl POE package is very good for the foundation service to
build  synch and asynch message delivery using the Stomp protocol.
The POE package has all the network transports. It is a cooperative multitasked
kernel in a single thread.

There is many ways to do it, but here is one design where we could layer as:

----------------------------------------------------
Client Interface
----------------------------------------------------
Synch and Asynch Message Delivery
-----------------------------------------------------
Stomp Protocol Implementation
-----------------------------------------------------
POE Transport and Other Services
-----------------------------------------------------

POE Links:
http://poe.perl.org/?Where_to_Get_POE
http://search.cpan.org/~rcaputo/POE/

-Sileshi

sileshi wrote
As you requested for testcases I used, I have attached a couple of files:


1. subscriber.pl - subscribes to a topic
subscriber.pl

2. publisher.pl - publishes to a topic

publisher.pl

Just run the subscriber first and then the publisher. Here is the error trace
of the Java client publish result:
$VAR1 = bless( {
                 'headers' => {},
                 'message' => undef,
                 'command' => undef
               }, 'Stomp::Response' );
send: Cannot determine peer address at Stomp/Client.pm line 65

That is _recv() method of send() method call:

sub _transmit {

        my ( $self, $request ) = @_;
    die "Not a valid request object\n" unless ref $request eq 'Stomp::Request';

    if ( _check_dest($request->destination) and $request->command ne 'ACK' ) {
        $request->set_ack;
    }

    $self->{'skt'}->send( $request->content );
}




Alan Willis wrote
Thanks for taking a look at this sileshi, I haven't had as much time as
I would have liked to perform further testing.
Can you send me a copy of the code to the perl client you are using to
receive messages from the Java JMS client?

As for async message delivery, I need a bit more time to think about how
this should be done.  I'm very open to all suggestions.
I wasn't aware that anyone was looking at this, I'll take some time to
work on this during this upcoming weekend.

thanks,
-alan

sileshi wrote:
>
> I have two Perl Stomp packages I have looked into:
> 1. Stomp-0.02 by Ian Holsman
> 2. Perl Stomp Interface by Allen Willis
>
> These are two different implementations of the Stomp prorocols.
> Which one is the latest? In both of them, I be able to do
> synschronous message send and receive when both the send
> and the receiver are Perl clients. But when I mix Java JMS client
> to publish to that same queue, the perl client did not receive
> the message at by Stomp-0.02, but the Perl Stomp Interface
> retuns an empty message with message trace:
> $VAR1 = bless( {
>                  'headers' => {},
>                  'message' => undef,
>                  'command' => undef
>                }, 'Stomp::Response' );
>
>
> Besides this minor problem they are reasonbly okay. They both need
> one important aspect of the Messaging domain: Asynchronous message
> delivery.
> It would be very valuable and essential to have Asynchronous Message
> delivery mechanism to really build publish and subscribe messaging.
> This does not require a change to protocol itself, rather it requires
> for client to register a message listener or callback method so that
> it could be notified when a message arrives.
>
> --
> View this message in context:
> http://www.nabble.com/Perl-Stomp-Packages-Feedback-tf2353711.html#a6555651 
>
> Sent from the stomp - dev mailing list archive at Nabble.com.
>
>
> ---------------------------------------------------------------------
> To unsubscribe from this list please visit:
>
>     http://xircles.codehaus.org/manage_email
>


--
Alan Willis
Ticketmaster
8800 Sunset Blvd, West Hollywood, CA 90069
Office: 310.360.2522 Mobile: 310.499.6358
Reply | Threaded
Open this post in threaded view
|

Re: Perl-Stomp Packages Feedback

Alan Willis

Thank you very much sileshi, I am going to take time to go over these during the weekend, unfortunately I'm at work at the moment.
I appreciate the time you've spent looking at this.

cheers,
-alan

sileshi wrote:
Re: [stomp-dev] Perl-Stomp Packages Feedback

Alan, my suggestion for implementing async message delivery is to use a solid
foundation at the bottom. I'm not a perl guru(haven't used it for 6 years).
I believe the Perl POE package is very good for the foundation service to
build  synch and asynch message delivery using the Stomp protocol.
The POE package has all the network transports. It is a cooperative
multitasked
kernel in a single thread.

There is many ways to do it, but here is one design where we could layer as:

----------------------------------------------------
Client Interface
----------------------------------------------------
Synch and Asynch Message Delivery
-----------------------------------------------------
Stomp Protocol Implementation
-----------------------------------------------------
POE Transport and Other Services
-----------------------------------------------------

POE Links:
http://poe.perl.org/?Where_to_Get_POE
http://search.cpan.org/~rcaputo/POE/

-Sileshi


sileshi wrote:
>
> As you requested for testcases I used, I have attached a couple of files:
>
>
> 1. subscriber.pl - subscribes to a topic
http://www.nabble.com/file/229/subscriber.pl subscriber.pl
>
> 2. publisher.pl - publishes to a topic
>
http://www.nabble.com/file/228/publisher.pl publisher.pl
>
> Just run the subscriber first and then the publisher. Here is the error
> trace
> of the Java client publish result:
> $VAR1 = bless( {
>                  'headers' => {},
>                  'message' => undef,
>                  'command' => undef
>                }, 'Stomp::Response' );
> send: Cannot determine peer address at Stomp/Client.pm line 65
>
> That is _recv() method of send() method call:
>
> sub _transmit {
>
>       my ( $self, $request ) = @_;
>     die "Not a valid request object\n" unless ref $request eq
> 'Stomp::Request';
>
>     if ( _check_dest($request->destination) and $request->command ne 'ACK'
> ) {
>         $request->set_ack;
>     }
>
>     $self->{'skt'}->send( $request->content );
> }
>
>
>
>
>
> Alan Willis wrote:
>>
>>
>> Thanks for taking a look at this sileshi, I haven't had as much time as
>> I would have liked to perform further testing.
>> Can you send me a copy of the code to the perl client you are using to
>> receive messages from the Java JMS client?
>>
>> As for async message delivery, I need a bit more time to think about how
>> this should be done.  I'm very open to all suggestions.
>> I wasn't aware that anyone was looking at this, I'll take some time to
>> work on this during this upcoming weekend.
>>
>> thanks,
>> -alan
>>
>> sileshi wrote:
>>>
>>> I have two Perl Stomp packages I have looked into:
>>> 1. Stomp-0.02 by Ian Holsman
>>> 2. Perl Stomp Interface by Allen Willis
>>>
>>> These are two different implementations of the Stomp prorocols.
>>> Which one is the latest? In both of them, I be able to do
>>> synschronous message send and receive when both the send
>>> and the receiver are Perl clients. But when I mix Java JMS client
>>> to publish to that same queue, the perl client did not receive
>>> the message at by Stomp-0.02, but the Perl Stomp Interface
>>> retuns an empty message with message trace:
>>> $VAR1 = bless( {
>>>                  'headers' => {},
>>>                  'message' => undef,
>>>                  'command' => undef
>>>                }, 'Stomp::Response' );
>>>
>>>
>>> Besides this minor problem they are reasonbly okay. They both need
>>> one important aspect of the Messaging domain: Asynchronous message
>>> delivery.
>>> It would be very valuable and essential to have Asynchronous Message
>>> delivery mechanism to really build publish and subscribe messaging.
>>> This does not require a change to protocol itself, rather it requires
>>> for client to register a message listener or callback method so that
>>> it could be notified when a message arrives.
>>>
>>> --
>>> View this message in context:
>>> http://www.nabble.com/Perl-Stomp-Packages-Feedback-tf2353711.html#a6555651
>>>
>>> Sent from the stomp - dev mailing list archive at Nabble.com.
>>>
>>>
>>> ---------------------------------------------------------------------
>>> To unsubscribe from this list please visit:
>>>
>>>     http://xircles.codehaus.org/manage_email
>>>
>>
>>
>> --
>> Alan Willis
>> Ticketmaster
>> 8800 Sunset Blvd, West Hollywood, CA 90069
>> Office: 310.360.2522 Mobile: 310.499.6358
>>
>>
>>
>
>

--
View this message in context: http://www.nabble.com/Perl-Stomp-Packages-Feedback-tf2353711.html#a6573663
Sent from the stomp - dev mailing list archive at Nabble.com.


---------------------------------------------------------------------
To unsubscribe from this list please visit:

    http://xircles.codehaus.org/manage_email



-- 
Alan Willis
Ticketmaster
8800 Sunset Blvd, West Hollywood, CA 90069
Office: 310.360.2522 Mobile: 310.499.6358