Currently I am working on a project based on microservices. Everone knows about the CircuitBreaker pattern, and why is so important to isolate dependencies by isolating points of access between the services, stopping cascading failures across them, and providing fallback options, all of which improve your system’s overall resiliency.

To achieve this goal I’m using Hystrix, from the Netflix OSS stack (a great stack of tools, by the way). Hystrix comes with a nice and usefull dashboard. To show the status of multiple services, a “cluster”, in a single dashboard, we have to use Turbine to collect and aggregate all the metric streams.

This project has a distributed architecture, with a lot of services spread around several vm, so I had to implement a custom host discovery plugin, based on Chabotto (more later).

TL;DL I decided to embed a jetty servlet container in a standalone JavaSE application. Easy job. But when I start the application and I tried to see the live stream connecting to the Turbine servelt, I recived an empty response with this stack in the log:

qtp933699219-25] WARN org.eclipse.jetty.server.HttpChannel - /
java.lang.NoSuchMethodError: javax.servlet.http.HttpServletResponse.getStatus()I
	at org.eclipse.jetty.server.handler.ErrorHandler.handle(
	at org.eclipse.jetty.server.Response.sendError(
	at org.eclipse.jetty.server.Response.sendError(
	at org.eclipse.jetty.servlet.ServletHandler$Default404Servlet.doGet(
	at javax.servlet.http.HttpServlet.service(
	at javax.servlet.http.HttpServlet.service(
	at org.eclipse.jetty.servlet.ServletHolder.handle(
	at org.eclipse.jetty.servlet.ServletHandler.doHandle(
	at org.eclipse.jetty.server.handler.ContextHandler.doHandle(
	at org.eclipse.jetty.servlet.ServletHandler.doScope(
	at org.eclipse.jetty.server.handler.ContextHandler.doScope(
	at org.eclipse.jetty.server.handler.ScopedHandler.handle(
	at org.eclipse.jetty.server.handler.HandlerWrapper.handle(
	at org.eclipse.jetty.server.Server.handle(
	at org.eclipse.jetty.server.HttpChannel.handle(
	at org.eclipse.jetty.server.HttpConnection.onFillable(
	at org.eclipse.jetty.util.thread.QueuedThreadPool.runJob(
	at org.eclipse.jetty.util.thread.QueuedThreadPool$

Mh…..the first line of the stacktrace is handleErrorPage(request, writer, response.getStatus(), reason); ; response is an HttpServletResponse, and the method getStatus() is there since Servlet 3.0. Turbine is a stable component, maybe is “not compatible” with Servlet 3.0? Lets check its dependencies (of the jar version):


Here it is! A dependency conflict with my embedded jetty (I’m building a fat-jar….). So, just remove servlet-api:2.5 and we are fine


Done! Now Turbine aggregates from all the services registered in Chabotto, my simple service regstry.