[Twisted-Python] Twisted-friendly Message bus

Bruce Mitchener bruce at cubik.org
Fri Jun 30 01:57:04 EDT 2006


Paul G wrote:
> Bruce Mitchener wrote:
>> I did have to write my own STOMP protocol implementation as the 
>> existing one for Python is not up to snuff.  I may be able to release 
>> it back to the ActiveMQ people, but I'm not entirely sure yet.
> 
> what were the problems with the existing implementation? is your 
> implementation integrated with twisted? more info (and even... gasp... 
> source) would be very sweet, seeing as this looks like my best option 
> for certain things at the moment.

I did two sorts of Twisted integration, first, I use it have a Protocol 
subclass.  Secondly, I have it using deferreds for request/reply type stuff.

The main problem that I recall with the existing code was that it 
assumed that it could just do a blocking read and get everything read in 
at once.  This clearly isn't true as a STOMP message may span multiple 
read()s from the network (and happens quite regularly under load).

I need to check with work about releasing it.  I'll try to do that 
tomorrow, but things are pretty crazy, so it might not happen until next 
week after the holiday.

But really, it is a pretty simple protocol.  The main tricks are in 
handling partial messages correctly.

The other way would be to look at the C++ OpenWire and STOMP 
implementations and think about wrapping one of them with SWIG.  I 
didn't go that route yet, but may for performance/features in the future.

  - Bruce




More information about the Twisted-Python mailing list