Tracing messages in Choreography with Sleuth and Zipkin

Tracing messages in Choreography with Sleuth and Zipkin

One of the challenges in building distributed system is having a good visibility of what is happening inside them. This challenge is only magnified when dealing with choreography- microservices, loosely coupled, communicating via messaging. In this article you will see how Sleuth and Zipkin help to solve that problem. One of the most important requirements for production ready microservices is being able to correlate logs. What does that mean? Having some sort of id, that will link logs from different services together. Of course you don’t want to link everything- you want to focus on a single request/process that is happening in the system. This was often done with MDC (Mapped Diagnostic Context) in slf4j. There is nothing wrong in using these technologies directly, but here I want to show you something better… ...

February 9, 2018 · 8 min · Bartosz Jedrzejewski
Handling bad messages with RabbitMQ and Spring Cloud Stream

Handling bad messages with RabbitMQ and Spring Cloud Stream

When dealing with messaging in a distributed system, it is crucial to have a good method of handling bad messages. In complicated systems, messages that are either wrong, or general failures when consuming messages are unavoidable. See how you can deal with this problem using Dead Letter Queues, RabbitMQ and Spring Boot Cloud. When dealing with messages in distributed systems it is important to know when things go wrong. When your services simply call one another it often is quite trivial- if your call failed, you know that you have a problem! With messaging it is often not so clear- as a service, if you successfully published a message on a queue- your responsibility ends. Whose responsibility is it then to ensure that the message published was correct and if not, that something will be done about it? Here, with the spirit of *“smart pipes”*we assume that it is the brokers responsibility to provide this service… ...

February 5, 2018 · 5 min · Bartosz Jedrzejewski
The business case for Microservices

The business case for Microservices

Microservices have won major following from technology enthusiasts all over the world. A couple weeks ago I was giving an introduction to Spring Cloud at one of Scott Logic breakfast technical talks (techie brekkies). All the developers in the room were interested and could see number of benefits and challenges with this, still rather new, approach. At the end of the session, during the question time I was asked by one of the business people in the room- “So, what is the business case for this, what business problem does it solve?”. It is easy to provide a few answers about scalability and maintainability of microservices, but I don’t think that speaks clearly to our business people. In this article I will look deeper into the business benefits provided by investing into microservices architecture. ...

February 3, 2018 · 8 min · Bartosz Jedrzejewski
What you need to know about Spring Boot 2.0 (RC1)

What you need to know about Spring Boot 2.0 (RC1)

With Spring Boot 2.0 release just around the corner (at the time of writing we have RC1) it is important to see what changes it brings. Even if you are not planning to migrate shortly, it is good to see what is new in this biggest Spring Boot release since the 1.0 version. In this blog post I won’t go through every detail, but cover the most important things. No more support for Java 7 and below Java 8 becomes a minimum requirement with Spring Boot. The release notes for the first milestone do not elaborate on that point further. Most developers will probably agree that this is for the better and if somehow you are still below Java 8 and planning to use the latest Spring Boot… Now you have a good business reason to upgrade. ...

January 31, 2018 · 5 min · Bartosz Jedrzejewski
Setting up RabbitMQ with Spring Cloud Stream

Setting up RabbitMQ with Spring Cloud Stream

Message queues are very important and useful tools that you can utilize for your Microservices oriented architecture. Many developers are hesitant using them with the fear that they may add too much complexity and learning curve to the understanding of their system. I will show you how to make use of RabbitMQ and Spring Cloud Stream to get some basic messaging routes set-up with a very little effort! Why use RabbitMQ RabbitMQ is an immensely popular message broker. In fact, the official website claims that this is the most popular open source message broker out there! This makes it a great candidate to be the message broker for your system. Popularity is not good enough reason for using something (but it usually brings plenty of benefits such as community and support), so rest assured- RabbitMQ has much more to offer than its fame. It is very easy to use (you will see) and it can reliably handle 20,000 messages per second with the largest documented deployment – the Instagram, doing more than 1,000,000 messages per second! ...

January 28, 2018 · 8 min · Bartosz Jedrzejewski
Seven Essential Skills for Microservices Developers

Seven Essential Skills for Microservices Developers

Microservices are gaining popularity and more developers end up working with them. If you are a developer who is going to work with microservices architecture, or an employer who is looking to hire someone- what are the most important skills for microservices developer to posses? Read on to find out. As with any emerging technologies and trends, there is some learning to be done to master it. It is the nature of our jobs as developers- to stay up to date with the latest and greatest patterns and architectures. So, what can you start doing now to get good at these microservices? Who should you look for to join your microservices oriented team? Here I gathered seven essential skills that will help any developer feel at home with microservices: ...

January 25, 2018 · 7 min · Bartosz Jedrzejewski
Starting with Microservices: Read “Building Microservices”

Starting with Microservices: Read “Building Microservices”

A lot of people want to start working with Microservices and don’t quite know where to start. I remember being there- finding that my next project is going to use microservices architecture and I should get familiar with it. Of course, I heard about microservices before and I have read some blog posts, but I felt that my knowledge had major gaps. If you are in this situation- worry no more! Just get yourself a copy of “Building Microservices” by Sam Newman and read it! Continue to find out more why I think this book has you covered. ...

January 24, 2018 · 4 min · Bartosz Jedrzejewski
Spring Cloud - Blueprint for Successful Microservices

Spring Cloud - Blueprint for Successful Microservices

If you are interested in building Microservices in the JVM ecosystem- you have to check out Spring Cloud. Spring Cloud is a project which goal is to make Microservices architecture and patterns simple and practical to use. Spring Boot provides opinionated way of making a Microservice, Spring Cloud gives you an opinionated framework for getting your architecture around them. The Scope of Spring Cloud Spring Cloud is a large project that is difficult to talk about as a whole. It is easier to look at individual components and see what they bring to the table. One great thing about Spring Cloud is that you are free to mix and match the components. You may for example want to use Spring Cloud Config server and nothing else. You can even use that with non-Java based microservices. Here are the parts of Spring Cloud with brief descriptions of what they do: ...

January 22, 2018 · 5 min · Bartosz Jedrzejewski
Java Enterprise and Microservices - meet Microprofile!

Java Enterprise and Microservices - meet Microprofile!

It seems that just recently majority of server-side development was done with some flavor of Enterprise Java. Who can forget J2EE, or JEE, writing all these JSP, JSF and Struts applications. It also feels that over the past few years there is less and less happening in that space. New projects are regularly picking alternative technologies and release and the release of JEE 8 did not have the same impact as Spring Boot or Microservices in general. Microprofile is an attempt to change that. Microprofile is the Enterprise Java answer to Microservices. ...

January 21, 2018 · 6 min · Bartosz Jedrzejewski
Microservices Toolbox - Docker

Microservices Toolbox - Docker

If you want to get into microservices development, you will want to run multiple things on your machine. Having services, databases, message brokers etc. all working on your machine without conflicts may be very difficult. Docker solves this problem beautifully. Docker and Containers So, what is docker and why is it such a big deal? Docker enables you to run different software on your own machine… But wait- can’t you already do that? Yes, you can, but not quite the same way like you do with Docker. ...

January 18, 2018 · 5 min · Bartosz Jedrzejewski