Over a million developers have joined DZone.

Displaying Graph of Microservices with Micro-infra-spring

· Java Zone

Check out this 8-step guide to see how you can increase your productivity by skipping slow application redeploys and by implementing application profiling, as you code! Brought to you in partnership with ZeroTurnaround.

As promissed, on the toomuchcoding.blogspot.com blog I'll be presenting features available in the 4financeITmicro-infra-spring library. Today I'm going to show you how easily can you sketch a very cool diagram of microservices in your system.


Initial scenario


Below you can see a draft version of a system that we wanted to build using microservices. For sure the architecture could have been designed in a better way (we could have used web sockets to push data instead of pulling them, or we could have transferred data in another way) but the idea was to play around with our tools and microservice templates with GUI (https://github.com/4finance/boot-microservice-gui) and without it (https://github.com/4finance/boot-microservice).


Graph of collaborators

Let's assume that your service is using micro-infra-spring and it's registered in Zookeeper under realm "X". If you go to /collaborators/view.html you will such a nice graph of microservice dependencies.

Each node represents the name of the microservice registered in Zookeeper in the same realm ("X" in this case). You can also find the microservices' IP address (we even support discerning multiple instances!).
Since we are talking about distributed systems it can turn out that one of the collaborators is down. Then the green dot will become a red one and the diagram will reflect that:


Summary

In this short post you could see how easy it is to sketch the whole graph of dependencies of your system. This is very handy when you want to have a fast overall view of your services. This can also help you show your management that your system is not only some intangible code abstraction but something really concrete.

The Java Zone is brought to you in partnership with ZeroTurnaround. Check out this 8-step guide to see how you can increase your productivity by skipping slow application redeploys and by implementing application profiling, as you code!

Topics:

Published at DZone with permission of Marcin Grzejszczak, DZone MVB. See the original article here.

Opinions expressed by DZone contributors are their own.

The best of DZone straight to your inbox.

SEE AN EXAMPLE
Please provide a valid email address.

Thanks for subscribing!

Awesome! Check your inbox to verify your email so you can start receiving the latest in tech news and resources.
Subscribe

{{ parent.title || parent.header.title}}

{{ parent.tldr }}

{{ parent.urlSource.name }}