Updates to Circuit Breaker Grails Plugin
The changes in this release consist mainly of exposing the internals of each Circuit Breaker to developers, ops, or anyone that might care.
At Tuesday night’s GUM meeting, I presented my experiences with AOP in Grails and we discussed the Circuit Breaker Plugin for most of the meeting. As part of that discussion, I talked about things that I would like to add to the plugin in the near future.
The main thing on my list was to expose the information about each Circuit Breaker via JMX. To make this happen, I first submitted a patch for the JMX Grails Plugin to allow any Spring bean to be exposed, rather than just Grails Services. Many thanks to Ken Sipe for committing my patch and releasing a new version of the plugin the same evening I submitted the patch!
All you have to do is install the JMX plugin and you can now view the current state of each Circuit Breaker via the JMX Console. In addition to viewing the current breaker state, failure threshold, current failure count, and open-state timeout, you can also manually trip or reset the breaker.
As part of the discussion around JMX on Tuesday, Brian mentioned that often he would prefer to use something quicker and more lightweight than JMX to get a snapshot of the current application state. Whether for easy scripting purposes or just to provide developers with easier access to the data, he thought a simple controller would be more beneficial than JMX integration. That’s now in the plugin as well.
Run grails install-circuit-breaker-controller after the plugin is installed to add CircuitBreakerController.groovy to your project. The controller displays the current state of each Circuit Breaker that has been configured in the application.
Hopefully more updates will come in the not-too-distant future, but before I get too deep I want to make sure I know what would be useful to add. Until I use it more, or get feedback from others, it’s hard to say what would actually add value (and not just clutter). My short list of next potential updates are:
- Additional metrics to expose via JMX and the Controller
- e.g. number of requests, average response time, number of good responses, number of errors, current number of concurrent requests, concurrent request high-water mark, etc
- Allow configuration of timeout & failureThreshold by exception type. From Release It!:
For example, you may choose to have a lower threshold for “timeout calling remote system” failures than “connection refused” errors.
In addition to my own usage, I definitely appreciate any feedback that you might have if you have a need to use the plugin.


Before RSS most of us had a blogroll of sites we visited daily, weekly, etc. With RSS we could let those sites come to us. Now, more and more, those sites are more stagnant and the real action is in the micro-post spaces such as Twitter. Sure people like us, software developers and designers may still use RSS but for the masses, RSS has not caught on, nor will it ever.


I have been a big fan of the PNG image format for several years, or I should really say I am a fan of the alpha-transparency* you can achieve with the 24 and 32-bit versions of the format (you get the more GIF-like transparency with the 8-bit PNGs). Not only that but the use of PNG files as backgrounds for divs and such allow me to better cut up and position elements using CSS in semantic ways that allows for more flexibility in the future as well as each component is self-contained.