The JEP-0066 messages for registering a subscription are very concise and relatively simple which I like:
<iq type="set" from="pgm@jabber.org" to="pubsub.jabber.org" id="create1"> <pubsub xmlns="http://jabber.org/protocol/pubsub"> <create node="generic/pgm-mp3-player"/> <configure/> </pubsub> </iq>
<iq type="result" from="pubsub.jabber.org" to="pgm@jabber.org" id="create1"/>
<iq type="set" from="pgm@jabber.org" to="pubsub.jabber.org" id="publish1"> <pubsub xmlns="http://jabber.org/protocol/pubsub"> <publish node="generic/pgm-mp3-player"> <item id="current"> <tune xmlns="http://jabber.org/protocol/tune"> <artist>Ralph Vaughan Williams</artist> <title>Concerto in F for Bass Tuba</title> <source>Golden Brass: The Collector's Edition</source> </tune> </item> </publish> </pubsub> </iq>
<iq type="result" from="pubsub.jabber.org" to="pgm@jabber.org" id="publish1"/>
And then for the actual events that are delivered to subscribers, the payload could be anything ... XML, JSON, etc. The message id, correlation id, redelivered, etc., custom message properties ... anything for the "Header" would be HTTP HEADERS rather then embedded in the payload.
The power I see in this is that you could easily implement something like this on many different platforms. You could have web server plugins, app servers, whatever. These components would do the guaranteed delivery, durable subscriptions, routing to N subscribers of a topic, etc. and the service impls would be able to be writen in any language. And then we'd have event driven architecture on the web vs. just in one off messaging systems (e.g., JMS).
2 comments:
It seems to me like an intrepid technologist could use the JMS spec as a model and easily craft the HTTP header-based spec.
Yes yes!
That is exactly what I'm thinking. Basically you would put JMS Header stuff and JMS Properties in HTTP Headers.
I have to think more though. And I need to read more of the other stuff I have stumbled across.
I think that is the easy part - the harder part is the runtime. Like ok, you have say 1000 subscribers to a topic. So you basically loop through them and to PUTS back to the URL that came with the subscription.
Ok so that is easy enough.
But what about clustering etc.?
Peer to Peer or broker based blah blah blah.
Post a Comment