Updates to Microphone | Microservices with Service Discovery for .NET

with No Comments

This post is a follow up on Introducing Microphone

The Microphone service discovery framework have gotten a lot of attention since I started developing it.
For new readers, this is a framework for .NET to build services/microservices using self hosting WebApi or NancyFx ontop of a service discovery mechanism.

ETCD Cluster provider

I have extend the service discovery support so that it would be possible to plug in any sort of discovery mechanism.
First up was CoreOs-ETCD, ETCD is a distributed key value store with support for time to live entries.
This makes it easy to use as a service discovery mechanism, one simply have to register a service instance with a time to live, e.g. 10 seconds.
And then make sure that your service sends heart beats to refresh the TTL once every 5 seconds.
If the service goes down and fails to send a heart beat, then the entry is removed from ETCD and thus no longer listed in any search result.

To enable ETCD in one of your Microphone based services, you simply pass the new EtcdProvider when bootstrapping your service.

Ebay Fabio – Consul load balancer

Another improvement in the latest bits is an addition to the already existing Consul.IO support.
A few days ago, Ebay released a Consul aware loadbalancer called Fabio – https://github.com/eBay/fabio
Fabio acts as a proxy ontop of Consul, exposing every registered service in the consul cluster through the local Fabio instance.
Fabio by default runs on port 9999, so to access any Consul service in your cluster, you can access it through localhost:9999/path-to-service-endpoint.
This means that it appears as if all of your services are available on the local machine, there is no need to lookup where a service is located, if it is registered in Consul, it is available through Fabio.

In Microphone, you can now enable Fabio support like so:

What this does is to register your service in Consul with an extra Consul Tag, so that Fabio can find it.
And it will also change the way service discovery works by returning the Fabio proxy endpoint instead of locating service instances.

Custom providers

As the Cluster provider support have been changed to allow injection of provider instances, it is now possible to create your own cluster provider.
E.g. ZooKeeper, Doozer or whatever provider you would like to use.

Future improvements

There have been a lot of requests for monitoring and resiliency, so those two topics are high on the TODO list.
I am currently looking into Netflix Hystrix and Polly for resiliency.
Monitoring support will most likely be pluggable, but might default to Elastic Search.

Stay tuned for more!

Follow Roger Alsing:

Developer, Mentor and Architect. Co-Founder of the Akka.NET actor model framework. akka.nethouse.se

Leave a Reply