Using Redis in Microservices Architecture

Using Redis in Microservices Architecture

In this article, we will look closer at a fascinating open source project. Meet Redis! You may be familiar with Redis already, in that case, you may be interested in the different use cases it has for microservices architecture. Read on to see how this “in-memory data structure store, database, cache, and message broker” can make your system better! What is Redis? I already revealed that in the introduction. To repeat (using redis.io own words): ...

August 3, 2018 · 5 min · Bartosz Jedrzejewski
Getting Started with Kafka in Spring Boot

Getting Started with Kafka in Spring Boot

Kafka seems to only be gaining in popularity. A few years ago you could mostly see it in Big Data engineering context. These days, Kafka is starting to power more common message-oriented architectures. In this article, I want to give you a basic introduction to working with Spring Boot and Kafka. Installing Kafka on your machine One common barrier to entry for people to hack around on their machines with Kafka is how tricky the installation can be. For that very reason, I have written “How to easily run Kafka with Docker for development”– I think you will find it especially useful if you are on Windows! ...

May 21, 2018 · 3 min · Bartosz Jedrzejewski
How to easily run Kafka with Docker for Development

How to easily run Kafka with Docker for Development

Kafka is becoming a popular addition to microservice oriented architectures. Despite its popularity, it may be tricky to run it on your development machine- especially if you run Windows. In this short article, I will show you a simple way to run Kafka locally with Docker. In order to run Kafka, you need a Zookeeper instance and Kafka instance. You also need these two instances to be able to talk to each other. ...

May 20, 2018 · 2 min · Bartosz Jedrzejewski
Reactive Streams in Java - introducing the new SPI

Reactive Streams in Java - introducing the new SPI

One of the new features of Java 9 is the introduction of the Reactive Streams SPI to the JDK. Reactive programming keeps gaining in popularity, mainly because it works well. If you are not familiar with the principles, I recommend checking out The Reactive Manifesto to which I subscribe. To learn more about Reactive Streams in Java, read on. Reactive Streams got introduced to Java as java.util.concurrent.Flow. Before looking into that, let’s see what are Reactive Streams and how can we make use of them. ...

April 4, 2018 · 4 min · Bartosz Jedrzejewski
Practical Choreography with Spring Cloud - Presentation

Practical Choreography with Spring Cloud - Presentation

On the 15th February 2018 I had a pleasure to speak at The JVM Roundabout Meetup in London. My topic was “Practical Choreography with Spring Cloud”. The idea behind the talk was to give practical advice on introducing choreography into microservices architecture. The emphasis is on practical. Choreography can be intimidating, especially for those not familiar with the pattern. Since I am a big advocate of Spring Cloud and I think it is a great framework for newcomers and experts alike, I demonstrate how it can be used to make that adoption easier. ...

February 20, 2018 · 1 min · Bartosz Jedrzejewski
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
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