PHP Stomp Client

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

PHP Stomp Client

dejanb
Hiram,

I've created a modified version of PHP Stomp client, which is based on your work. I've made a substantial amount of changes, so it was impossible to make a proper patch. For that reason I've currently put it on my site. This blog post http://www.nighttale.net/resources/php-stomp-client.html explains my motivation and changes that I have made.

If you find time, give it a try and let me know your thoughts. If you are interested, we can commit it to Codehaus repository and continue all further work there.

Thanks,
Dejan
Reply | Threaded
Open this post in threaded view
|

Fwd: PHP Stomp Client

Dejan Bosanac-2
Let me try again ...

---------- Forwarded message ----------
From: Dejan Bosanac <[hidden email]>
Date: Sep 14, 2006 2:58 PM
Subject: PHP Stomp Client
To: [hidden email]

Hiram,

I've created a modified version of PHP Stomp client, which is based on your work. I've made a substantial amount of changes, so it was impossible to make a proper patch. For that reason I've currently put it on my site. This blog post <a href="http://www.nighttale.net/resources/php-stomp-client.html" target="_blank" onclick="return top.js.OpenExtLink(window,event,this)">http://www.nighttale.net/resources/php-stomp-client.html explains my motivation and changes that I have made.

If you find time, give it a try and let me know your thoughts. If you are interested, we can commit it to Codehaus repository and continue all further work there.

Thanks,
Dejan
Reply | Threaded
Open this post in threaded view
|

Re: PHP Stomp Client

brianm
In reply to this post by dejanb

On Sep 14, 2006, at 5:58 AM, Dejan Bosanac wrote:

I've created a modified version of PHP Stomp client, which is based on your work. I've made a substantial amount of changes, so it was impossible to make a proper patch. For that reason I've currently put it on my site. This blog post http://www.nighttale.net/resources/php-stomp-client.html explains my motivation and changes that I have made.

Nice!

-Brian
Reply | Threaded
Open this post in threaded view
|

Re: PHP Stomp Client

dejanb
Thanks.

I just finished the first draft of JSON encoding/decoding of stomp messages. The whole description is available at

http://www.nighttale.net/resources/stomp-and-json.html

Any feedback is appreciated.

Also, if you are interested, I would like to help you implement pluggable stomp message handlers in ActiveMQ. So if you have some work in progress (or even just ideas how it should look like), please let me know.

Dejan

On 9/15/06, Brian McCallister <[hidden email]> wrote:

On Sep 14, 2006, at 5:58 AM, Dejan Bosanac wrote:

I've created a modified version of PHP Stomp client, which is based on your work. I've made a substantial amount of changes, so it was impossible to make a proper patch. For that reason I've currently put it on my site. This blog post <a href="http://www.nighttale.net/resources/php-stomp-client.html" target="_blank" onclick="return top.js.OpenExtLink(window,event,this)">http://www.nighttale.net/resources/php-stomp-client.html explains my motivation and changes that I have made.

Nice!

-Brian

Reply | Threaded
Open this post in threaded view
|

Re: PHP Stomp Client

James Strachan-2
On 9/18/06, Dejan Bosanac <[hidden email]> wrote:
> Thanks.
>
> I just finished the first draft of JSON encoding/decoding of stomp messages.
> The whole description is available at
>
> http://www.nighttale.net/resources/stomp-and-json.html
>
> Any feedback is appreciated.

Awesome stuff!!!


> Also, if you are interested, I would like to help you implement pluggable
> stomp message handlers in ActiveMQ. So if you have some work in progress (or
> even just ideas how it should look like), please let me know.

We've a Stomp transport for ActiveMQ which is here...
http://incubator.apache.org/activemq/maven/activemq-core/xref/org/apache/activemq/transport/stomp/package-summary.html

which can currently deal with all the stomp messages nicely. Maybe you
mean to extend that? Or did you have something else in mind?

--

James
-------
http://radio.weblogs.com/0112098/

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

    http://xircles.codehaus.org/manage_email

Reply | Threaded
Open this post in threaded view
|

Re: PHP Stomp Client

dejanb
Thanks James.


>
> We've a Stomp transport for ActiveMQ which is here...
> http://incubator.apache.org/activemq/maven/activemq-core/xref/org/apache/activemq/transport/stomp/package-summary.html
>
> which can currently deal with all the stomp messages nicely. Maybe you
> mean to extend that? Or did you have something else in mind?
>


In one of his comments Brian said that he plans to create pluggable
handling framework for stomp messages for ActiveMQ 4.1.

Following that idea, I have even found a discussion on this topic

http://mail-archives.apache.org/mod_mbox/geronimo-activemq-dev/200606.mbox/%3Caf2843cd0606131045k1084ec85qd337a076af47c363@...%3E

which is related to handling of ByteMessages.


I thought that this is exactly what I would like to have for handling
of this kind of "map" messages. As I see it, it would be the best to
extend functionality of the

public  ActiveMQMessage convertMessage(StompFrame command)

method in the

org.apache.activemq.transport.stomp.ProtocolConverter

class

I can add hard-coded mapping for this special case, or as Brian said,
introduce some additional flexibility by allowing developers to submit
their own converter classes at this point. Who knows what other
"protocol" on top of Stomp someone would be interesting to create in
the future (or what kind of object serialization/deserialization to
perform).

The only thing that I'm not sure of is how these plugins would be configured.

In any case, I won't start doing any work on this before we agree on
how this functionality should look like, or whether it is necessary to
make any changes at all.

Dejan

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

    http://xircles.codehaus.org/manage_email

Reply | Threaded
Open this post in threaded view
|

Pluggable Stomp Message Mapping (was: [stomp-dev] PHP Stomp Client)

brianm
(Replying at top as it is a long message :-)

The mapping be configured by naming a "converter" of some kind in the  
activemq.xml

This is a bit tricksier than it might be because the activemq.xml is  
just a specialized spring config which reads a lot of stuff from a  
URL syntax, and adding Java classnames in a URL is the ick.

I've started poking around and my current plan is to pull the AMQ  
message creating and Stomp message creation bits out of the protocol  
converter and use an implementation of some mapping interface to do  
the conversion.

Exactly what the interface needs to look like I am not sure yet. In  
order to handle largish messages, it should probably deal with  
DataInput (AMQ's stream/buffer+channel hiding thing) instances, but  
we'll have had to already parse the type to get this far, so it may  
be a case of doing some parsing of the headers, and passing the data  
input in to be munged, or it may fall out that something else is more  
useful.

For encoding AMQ to stomp, we are faced with something similar -- we  
pass in the JMS message, which might be a stream message with a large  
body, we probably want to be able to "chunk" it out, that means  
either making a stomp frame abstraction which can read from a stream  
and is returned by the converter, or having the converter actually  
"send" the message on the wire. Not sure which I like more.

Thoughts?

-Brian

On Sep 18, 2006, at 7:45 AM, Dejan Bosanac wrote:

> Thanks James.
>
>
>>
>> We've a Stomp transport for ActiveMQ which is here...
>> http://incubator.apache.org/activemq/maven/activemq-core/xref/org/ 
>> apache/activemq/transport/stomp/package-summary.html
>>
>> which can currently deal with all the stomp messages nicely. Maybe  
>> you
>> mean to extend that? Or did you have something else in mind?
>>
>
>
> In one of his comments Brian said that he plans to create pluggable
> handling framework for stomp messages for ActiveMQ 4.1.
>
> Following that idea, I have even found a discussion on this topic
>
> http://mail-archives.apache.org/mod_mbox/geronimo-activemq-dev/ 
> 200606.mbox/%
> [hidden email]%3E
>
> which is related to handling of ByteMessages.
>
>
> I thought that this is exactly what I would like to have for handling
> of this kind of "map" messages. As I see it, it would be the best to
> extend functionality of the
>
> public  ActiveMQMessage convertMessage(StompFrame command)
>
> method in the
>
> org.apache.activemq.transport.stomp.ProtocolConverter
>
> class
>
> I can add hard-coded mapping for this special case, or as Brian said,
> introduce some additional flexibility by allowing developers to submit
> their own converter classes at this point. Who knows what other
> "protocol" on top of Stomp someone would be interesting to create in
> the future (or what kind of object serialization/deserialization to
> perform).
>
> The only thing that I'm not sure of is how these plugins would be  
> configured.
>
> In any case, I won't start doing any work on this before we agree on
> how this functionality should look like, or whether it is necessary to
> make any changes at all.
>
> Dejan
>
> ---------------------------------------------------------------------
> To unsubscribe from this list please visit:
>
>    http://xircles.codehaus.org/manage_email
>


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

    http://xircles.codehaus.org/manage_email

Reply | Threaded
Open this post in threaded view
|

Re: Pluggable Stomp Message Mapping (was: [stomp-dev] PHP Stomp Client)

dejanb
I think that in order to make this framework usable, it has to be
simple. It could be a simple interface such as

public interface ProtocolTransformer {
         public StompFrame convertMessage(ActiveMQMessage message)
throws IOException, JMSException;

         public  ActiveMQMessage convertMessage(StompFrame command)
throws IOException, JMSException;
}

this two methods would be called at appropriate places (probably at
the begging) of the methods in the ProtocolConverter class. In this
way we would allow developers to change message type and/or set
appropriate headers, which seems to me would be more than enough.

The one thing that I'm not sure of is how the ProtocolConverter will
decide which transformers it should call. For incoming Stomp messages
someone mentioned a solution which seems fine: to put an extra header
in the stomp message (such as amq-msg-type or activemq-transformation
or whatever) which would have a full class name of the transformer to
be applied. Then the ProtocolConverter would try to load this
transformer and if it succeed it would apply the transformation.

But this solution is not working for messages that are sent from the
broker to the stomp clients. We need some mechanism which will say,
apply this transformation to the ByteMessages so we need a mechanism
that will be able to register all transformers to the
ProtocolConverter and then every transformer would be responsible to
detect whether it should or not change the message.

For configuring purposes we could use Service Provider JAR
functionality (http://java.sun.com/j2se/1.5.0/docs/guide/jar/jar.html#Service%20Provider)
since it is the only way I can think of that not requires external
configuration.

Two questions that we need to address:

1. do we want to enable more than one transformation to be applied?
2. how this framework will affect overall performances?

What do you think?

Regards,
Dejan

On 9/19/06, Brian McCallister <[hidden email]> wrote:

> (Replying at top as it is a long message :-)
>
> The mapping be configured by naming a "converter" of some kind in the
> activemq.xml
>
> This is a bit tricksier than it might be because the activemq.xml is
> just a specialized spring config which reads a lot of stuff from a
> URL syntax, and adding Java classnames in a URL is the ick.
>
> I've started poking around and my current plan is to pull the AMQ
> message creating and Stomp message creation bits out of the protocol
> converter and use an implementation of some mapping interface to do
> the conversion.
>
> Exactly what the interface needs to look like I am not sure yet. In
> order to handle largish messages, it should probably deal with
> DataInput (AMQ's stream/buffer+channel hiding thing) instances, but
> we'll have had to already parse the type to get this far, so it may
> be a case of doing some parsing of the headers, and passing the data
> input in to be munged, or it may fall out that something else is more
> useful.
>
> For encoding AMQ to stomp, we are faced with something similar -- we
> pass in the JMS message, which might be a stream message with a large
> body, we probably want to be able to "chunk" it out, that means
> either making a stomp frame abstraction which can read from a stream
> and is returned by the converter, or having the converter actually
> "send" the message on the wire. Not sure which I like more.
>
> Thoughts?
>
> -Brian
>
> On Sep 18, 2006, at 7:45 AM, Dejan Bosanac wrote:
>
> > Thanks James.
> >
> >
> >>
> >> We've a Stomp transport for ActiveMQ which is here...
> >> http://incubator.apache.org/activemq/maven/activemq-core/xref/org/
> >> apache/activemq/transport/stomp/package-summary.html
> >>
> >> which can currently deal with all the stomp messages nicely. Maybe
> >> you
> >> mean to extend that? Or did you have something else in mind?
> >>
> >
> >
> > In one of his comments Brian said that he plans to create pluggable
> > handling framework for stomp messages for ActiveMQ 4.1.
> >
> > Following that idea, I have even found a discussion on this topic
> >
> > http://mail-archives.apache.org/mod_mbox/geronimo-activemq-dev/
> > 200606.mbox/%
> > [hidden email]%3E
> >
> > which is related to handling of ByteMessages.
> >
> >
> > I thought that this is exactly what I would like to have for handling
> > of this kind of "map" messages. As I see it, it would be the best to
> > extend functionality of the
> >
> > public  ActiveMQMessage convertMessage(StompFrame command)
> >
> > method in the
> >
> > org.apache.activemq.transport.stomp.ProtocolConverter
> >
> > class
> >
> > I can add hard-coded mapping for this special case, or as Brian said,
> > introduce some additional flexibility by allowing developers to submit
> > their own converter classes at this point. Who knows what other
> > "protocol" on top of Stomp someone would be interesting to create in
> > the future (or what kind of object serialization/deserialization to
> > perform).
> >
> > The only thing that I'm not sure of is how these plugins would be
> > configured.
> >
> > In any case, I won't start doing any work on this before we agree on
> > how this functionality should look like, or whether it is necessary to
> > make any changes at all.
> >
> > Dejan
> >
> > ---------------------------------------------------------------------
> > To unsubscribe from this list please visit:
> >
> >    http://xircles.codehaus.org/manage_email
> >
>
>
> ---------------------------------------------------------------------
> To unsubscribe from this list please visit:
>
>     http://xircles.codehaus.org/manage_email
>
>

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

    http://xircles.codehaus.org/manage_email