Thursday, May 1, 2008

Messaging and Active MQ

In the proposal I eluded to using web services to communicate between the central controller and the generators, but I think I'm going to use Active MQ instead.

I spoke with Ryan yesterday and he said the team is using ActiveMQ for messaging between processes and other apps in their group and it would be trivial for me to use their production bus.

AMQ appears to address all of the requirements for communication for my project and leaves a lot of room to grow new functionality in the future.

The standard team message queues are set up as follows:

Standard base queue path
/queue/(env)[production||development]/(app)[application name]/

Postfix non standard queue path
(standard)/(action)/(arguments)


to get this working in ruby I need to do the following:
Ruby --> `gem install stomp`
Perl --> Net::Stomp

Some things to look out for with ActiveMQ

Bug #1
There's a bug in ActiveMQ that makes all messages into binary messages if the header size is set. The fix for this is to:

Comment out the `content-length` header in `def transmit` in

/usr/local/lib/ruby/gems/1.8/gems/stomp-1.0.5/lib/stomp.rb

Bug #2
There's a bug in serialize to YML with arrays so I'm going to use serialize to XML

1 comment:

Unknown said...

going with xml is a fine solution. Alternative if you want to stick with YAML is to use Audrey Tang's YAML::Syck perl library