Hi Hiram On Dec 14, 2007 6:40 PM, Hiram Chirino <[EMAIL PROTECTED]> wrote: > I personally think that a STOMP client should request a transformation > strategy. For example on a subscribe, he could do > > SUBSCRIBE > destination: /queue/foo > transformation: jms-json > ack: client > > And on the reverse side, The send could look like: > > SEND > destination:/queue/a > transformation: jms-json > > ["Hello World",1] > ^@ > > And have the Stomp transport handle those "transformation" headers by > looking up the "jms-json" transformation in the spring context. This > would allow the broker to have extensible transformations. And the > looked up object would just need to implement the following interface: > > http://activemq.apache.org/maven/activemq-core/apidocs/org/apache/activemq/transport/stomp/FrameTranslator.html
That's great. This idea has been discussed on the list some time ago and I think it's a good approach. I though that maybe it could be useful for other transports as well, but you're probably right that we should keep this Stomp-related for now. A few questions about your idea: * Maybe it would be better to have "transfomers" registered at boot time, rather then doing lookups when message arrives? If so, there has to be a mechanism to configure Stomp transport with transformers that will be used. What method do you propose for this, if any? Maybe StompTransportFactory could do lookup on init? * We have to allow users to add their "domain" classes to the amq classpath, as I guess the most of them will want to transform XML/JSON to objects of those classes. That's not a problem for brokers embedded in applications, but I guess they could do that in the off-the-shelf broker by adding appropriate JAR to the lib/ folder? > > Just need to find someone who is willing to take a stab at enhancing > the stomp transport so that it does those "transfromation" header > handling logic. And add a few more interesting implementations of > FrameTranslator. No problem about that. I'll invest some time in this, both in amq and PHP Stomp client. But before that I thought I handle authentication for Stomp as it is far more important IMHO. I'll start with this patch (https://issues.apache.org/activemq/browse/AMQ-1272) add test cases and implement proper behavior. Cheers -- Dejan Bosanac www.scriptinginjava.net
