{"id":2282,"date":"2011-12-11T01:39:16","date_gmt":"2011-12-11T00:39:16","guid":{"rendered":"http:\/\/www.devco.net\/?p=2282"},"modified":"2011-12-13T12:48:20","modified_gmt":"2011-12-13T11:48:20","slug":"common-messaging-patterns-using-stomp","status":"publish","type":"post","link":"https:\/\/www.devco.net\/archives\/2011\/12\/11\/common-messaging-patterns-using-stomp.php","title":{"rendered":"Common Messaging Patterns Using Stomp – Part 1"},"content":{"rendered":"

As most people who follow this blog know I’m quite a fan of messaging based architectures. I am also a big fan of Ruby and I like the simplicity of the Stomp Gem to create messaging applications rather than some of the more complex options like those based on Event Machine (which I am hard pressed to even consider Ruby) or the various AMQP ones.<\/p>\n

So I wanted to do a few blog posts on basic messaging principals and patterns and how to use those with the Stomp gem in Ruby. I think Ruby is a great choice for systems development – it’s not perfect by any stretch – but it’s a great replacement for all the things systems people tend to reach to Perl for.<\/p>\n

Message Orientated Middleware represents a new way of inter process communications, different from previous approaches that were in-process, reliant on file system sockets or even TCP or UDP sockets. While consumers and producers connect to the middleware using TCP you simply cannot really explain how messaging works in relation to TCP. It’s a new transport that brings with it its own concepts, addressing and reliability.<\/p>\n

There are some parallels to TCP\/IP wrt to reliability as per TCP and unreliability as per UDP but that’s really where it ends – Messaging based IPC is very different and best to learn the semantics. TCP is to middleware as Ethernet frames are to TCP, it’s just one of the possible ways middleware brokers can communicate and is at a much lower level and works very differently.<\/p>\n

Why use MOM<\/strong>
\nThere are many reasons but it comes down to promoting a style of applications that scales well. Mostly it does this by a few means:<\/p>\n