RabbitMQ Essentials

by John Turner

Posted on August 21, 2012


I have been spending some time looking at AMQP. One of the things that interests me about AMQP is the concept of an Exchange and the ability for clients to create and destroy resources. A popular implementation of message oriented middleware that uses the AMQP protocol is RabbitMQ. In order to learn a bit more about RabbitMQ I watched the RabbitMQ Essentials self-paced training (which at the time of writing is provided for free by VMware).

1. Introduction to Messaging and AMQP

The training presentation starts with and introduction to messaging and AMQP. I’ve worked with JMS since it’s initial release so most of this material was very familiar however it was worth the 10 minutes to recap. This module provides a brief description of synchronousasynchronous communication and some of the characteristics of both. It goes on to describe messaging and message oriented middleware and how it supports asynchronous communication (and why asynchronous communication is desirable within enterprise systems). A (rather good) description of how components become coupling ‘in time’ is provided.

The section goes on to describe the JMS architecture and its main components i.e. Provider, Client, Message and Administered Objects. Similarly, the AMQP architecture is introduced along with its main components i.e. Broker, Connection and Channel. The concept of an AMQP Exchange is introduced along with a description of the exchanges supported by RabbitMQ (direct, fan out, topic and header exchange).

The module concludes with a description of the deficiencies of JMS. I found this a little weak to be honest as for me, the biggest deficiency is that JMS is rather static in nature. For example, you create a Connection Factory, Queue and Topic etc. as part of a deployment as opposed to dynamically at runtime.

2. RabbitMQ Product Presentation

This module provides a high level overview of RabbitMQ. It lists the features of RabbitMQ as:

  • Support for durable communication
  • High availability
  • Good throughput
  • High scalability
  • SSL support
  • Access control
  • Extensibility

It goes on to describe the installation process on Windows and the files that are created as part of the install. These are categorised as configuration files, data files and log files.

The module wraps up with an introduction to the RabbitMQ management plugin and a short description of the management web interface, REST API and command lint utility.

3. RabbitMQ Development

This module walked through the development of a message producer and a message consumer using Java. Again, this is reasonably easy to follow for anyone who is familiar with Java and JMS. It starts by describing how to create a producerconsumer project using Maven. The API for creating a Connection Factory, Channel, Exchange and Queue as well as how to bind a Queue to an Exchange is described in the context of the message producer example.

Similarly, the module provides a walk through of a Java message consumer and describes the difference between a subscription and explicit message retrieval.

For me, the most interesting section of this module was the section that describes the behaviour of the Direct, Fan Out and Topic exchanges.

4. RabbitMQ High Availability and Clustering

This module began with an overview of active/active and active/passive node configuration, however toward the end of the module the active/passive configuration was described as legacy. It went on to describe RabbitMQ clustering before going into the detail of how to configure a cluster. One of the interesting topics for me was that of mirrored queues. The material appeared to suggest that the node(s) on which mirrors are to be created should be explicitly specified during queue creation which is a little disconcerting. My expectation from previous material was that the cluster would exhibit a greater degree of autonomic behaviour.

5. RabbitMQ Advanced Development

This module focusses on the reliability, durability and scalability provided by RabbitMQ. It does this by describing support for transactions (both local and distributed), acknowledgements, and persistent messaging. Quite a few choices were described which take a bit of time to absorb.

Thoughts

AMQP and RabbitMQ is significantly different from the typical JMS compliant messaging platforms that I would be more familiar with. The modules on HA, clustering and advanced development have suggested a number of areas that I would like to become more familiar with. The best way to do this will be to roll my sleeves up and implement some typical message exchange patterns.


Agile Testing: A Practical Guide for Testers and Agile Teams

by John Turner

Posted on April 01, 2012


I have worked with testers on an Agile team before and it has worked very well for both the team and the customer. In my previous role at Bank of Ireland, testers who had come from a traditional testing background worked within our teams to help ensure we had quality deliverables at the end of each iteration. It was different from traditional test approaches in that they were sitting with the team, collaborated constantly and were integral to the process of developing the solution. I never found them critical of poor quality or guilty of ring fencing roles and responsibilities. This was refreshing and without doubt a better way of ensuring quality than those I had experienced before.

Recently, here at Paddy Power, we have been interviewing for a number of open Agile tester positions. I’‘m pretty sure I know what a good Agile tester looks like but I have often struggled to fully articulate what that entails. I have had this book on my shelf for a couple of months and now I’m looking to it to help me fully understand what an Agile tester is.

Read More

SpringOne 2GX: Implementing Scalable HA Architectures with Spring Integration

by John Turner

Posted on January 02, 2012


Another session from SpringOne 2GX 2011 but this time focusing on Spring Integration. Implementing Scalable HA Architectures with Spring Integration is presented by Gary Russell and David Turanski who are currently working on a project with a significant element of enterprise integration for EMC. A solid understanding of Spring Integration is assumed by the presenters and the focus is more on the application of Spring Integration to support ‘Single Source’ and ‘Strict Order’ processing of messages. The presentation included the following topics:

  • High availability architecture concepts
  • Spring Integration basics
  • Competing consumers
  • Challenges with competing consumers

The high availability architecture concepts were presented to frame the session. There was little depth of discussion or new ground covered. The same could be said for the section introducing the basics of Spring Integration. The guys did a good job of describing competing consumers and the challenges of using competing consumers for ‘Single Source’ processing.

For the remainder of the session Gary and David discussed the solution they were developing for EMC. I was interested in particular to hear what the presenters had to say on the subject of ‘Single Source’ processing in a HA environment as we have similar problems to be solved at Paddy Power. If you are new to this type of processing I think you will find the content a little difficult to follow and if you are not new to this you probably won’t take a lot away from the discussion.

It was quite a frustrating session to watch as there was a significant amount of time spent trying to execute the demo application. I would have liked if their own solutions were described more concisely and contrasted against some of the other solutions as leveraged by a number of peer-to-peer protocols such as chord.


SpringOne 2GX: Getting Started With Spring Security 3.1

by John Turner

Posted on January 02, 2012


I’ve used Spring Security often. Sometimes to provide what would be considered relatively straight forward authentication and authorisation and on other occasions to provide multi-step authentication (using pre-authentication) and complex authorisation. In the Getting Started With Spring Security 3.1 session at SpringOne 2GX 2011 Rob Winch introduced Spring Security and the new features of Spring Security 3.1.

He starts his presentation with a high level overview of the Spring Security framework and the variety of support it provides. For those who have not used Spring Security this was quite informative and for those who are familiar with the framework it was a useful recap. Spring Security is organised into the core framework and a number of extensions that provide support for OAuth, SAML, Kerberos etc. This was mentioned by way of an overview and not delved into in any depth.

Havig used Spring Security before, I was particularily interested in what is new in version 3.1. The two additions that I was particularily happy to see were:

  • namespace support for multiple http elements
  • a stateless authentication mode for RESTful services.

Unfortunately Rob did not delve into the stateless authentication mode.

Much of the session focused on a demo web application (Secure Mail) and how to leverage Spring Security to implement authentication and authorisation. This was a through walk through the demo application that covered everything from the initial configuration of spring security to session management, user registration and proxy based authorisation.

In particular, I found the section on proxy based authorisation was well presented. The difference between interface based proxies and class based proxies was explained along with the pro’s and con’s for both. I also found the tips on preventing Spring Security from permeating into the application source code useful. I hate seeing dependencies on framework code proliferate application code.

Rob was an informative and engaging presenter and this session is definitely worth watching if you find yourself with a free hour and a half.


Arduino Starter Kit - Day 2

by John Turner

Posted on December 23, 2011


Following on from my first look at the Arduino, I freed up a few hours in my day to continue with the tutorial projects.

Project 6 builds on the LED chase effect that was created by project 5 and adds a potentiometer that adjusts the speed of the chase. Shame I dismantled project 5 when I finished up on day 1. It took me a few minutes to reconfigure all the LEDs and connect them to the Arduino. Once this was done attaching the potentiometer and the update to the sketch was quick and easy. I skipped the two exercises at the end of project 6 as they were effectively programming exercises.

Project 7 involves creating a single pulsating LED. This is achieved by doing an analog write to the output pin (the output pin is a digital pin). An interesting explanation of how we get a digital pin to behave like an analog pin follows with a description of PWM (Pulse Width Modulation).

Project 8 creates a mood light that uses a clear red, clear green and clear blue LED and adjusts the brightness of each to simulate a range of colours. The sketch was interesting as it managed the transitions so that transitions from one colour to another were not too abrupt.

Project 9 creates a fire effect using two yellow and a red LED. The wiring and sketch are more basic than the last couple of projects so there really wasn’t a lot to this project.

Project 10 uses the same circuit as project 8 but uses the serial monitor to manually input commands to the Arduino. Simple commands allow manual control of each of the LEDs individually.

Project 11 puts away all the LEDs and starts to play with some of the other components, namely the Piezo Sounder and the terminal block. The circuit is trivial but we start to see new functions within the sketch that control the Piezo Sounder.

Project 12 uses the Serial Temperature Sensor to output temperature readings to the Serial Monitor. There appeared to be an issue (which I could not find the source of) that caused my PC to freeze when I connected this circuit. It seemed to be a problem with the sensor itself. This was the first problem I had with the kit so far.

Project 13 uses a light sensor to adjust the rate at which a LED flashes. Normal service resumed and after putting together the circuit and downloading the sketch the LED reacted to the lighting as expected. I’m a little relieved that there is nothing wrong with the board!

I’m not going to finish projects 14, 15 and 16 as the next thing I want to try is to control the Arduino from a Java program. But that’s for another day.


About - MonkeyLittle

Thoughts on Software Engineering, Infrastructure and everything in between.

Twitter Feed