Retry logic in Spring Multirabbit

Some days ago I realized spring-multirabbit had a bug that affected the retry support since its first version. I was browsing for spring-multirabbit in stackoverflow and found this question reporting the issue which was also linked to the original issue that I took but never had the time to check. Thank you folks that opened the question and issue. I just launched the following spring-multirabbit versions that fix it: v3.3.1 v3.2.1 v3.1.7 v3.0.2 v2.7.4 v2.6.3 And here is how to use it. Suppose …

Read More

ConnectionDetails in Spring Multirabbit 3.1.0

The main change introduced in Spring Multirabbit 3.1.0 was the support for ConnectionDetails (GH-34657). ConnectionDetails was introduced in Spring Boot 3.1.0 (commit) and enables Spring’s auto-configuration to utilize connection information from other sources than configuration properties. In other words, it provides a way to overwrite some key properties for connections. It has an impact not only on RabbitMQ connections but a bunch of other integrations like jdbc, mongo, kafka, …

Read More

Spring Multirabbit's update in 2024

spring-multirabbit (maven) project was discontinued in February 2024 and FREE NOW will not maintain it any longer. I decided to fork it and continue supporting it myself under my github.com/rwanderc/spring-multirabbit repository and releasing under my wandercosta.com maven namespace. DISCLAIMER: The library and this initiative to continue supporting it are completely independent of my previous or current employers. I created this project in 2019 while working at FREE NOW, but I stepped away from …

Read More

Verified commits in GitHub

In this post, we will enable you to have GitHub verified commits. For that, you have to: Create a GPG key Configure GitHub with its public key Configure your git to sign commits Creating a GPG key Install the tool in your OS. brew install gpg // MacOS apt install gnupg2 // Linux (Debian-based) If you just installed the tool, you should have no keys yet. You can check by running:

Read More

Git Cheat Sheet

Below is a table with commands I don’t run frequently enough to remember them, and have to rely on searching on internet again and again. Now it’s saved somewhere. 😀 Last update: October 3rd, 2023. Operation Command Commit without files git commit -m "some message" --allow-empty List commits in one line each git log --oneline Remove local tag git tag -d <tag_name> Remove remote tag git push --delete origin <tag_name> Stash changes git stash Retrieve changes from stash git …

Read More

5 ways to write better code

Forget for a moment about correctness, efficiency, or performance. If your code has 10 nested ifs or nested loops, the computer will be able to process and run it the same way as if it had one or two. No matter how badly written is the code, once it is compiled or interpreted without failure, the computer can run it. However, developers should write code not only for computers to run but also for other developers to understand and continue evolving it. Writing bad code will cause bad …

Read More

Spring Multirabbit

SpringBoot doesn’t offer a very easy way of handling multiple RabbitMQ servers without introducing the complexity of SpringCloud Stream or the need to manually provide multiple connection factories in code. The spring-multirabbit library solves this problem, requiring none or minimal changes to the code and very simple extension of the configuration. How to use? Add spring-boot-starter-amqp and spring-multirabbit into the dependencies of the project. Bellow, an example for Maven. …

Read More

Two and a half years away

It’s been a long time since a last published a post on the blog. Shame shame shame! My last published post was Your first SpringBoot app in 5 steps on September 2019, 2.5 years ago. SpringBoot was in its version 2.0.8. Today, SpringBoot is in version 2.6.6. But why did this happen? The reason is clear: laziness! Kidding! Or better described… partially kidding! Besides a bit of laziness, many things happened during this time:

Read More

Your first SpringBoot app in 5 steps

SpringBoot is made to be powerful and easy! It’s very nice to work with and you will need only these 5 steps for your first app in a Maven project: Define the SpringBoot parent lib Define the dependency to the SpringBoot web library Define the Maven plugin for SpringBoot Create the main method Create a controller with an endpoint Parent SpringBoot lib This is the main and first step when creating a SpringBoot application. The parent library will import basic dependencies from Spring into …

Read More

5 popular decorators from Java

As a software developer, you probably know the Decorator Design Pattern, described in GoF. If not, read this first. Java has some nice decorators that can make your life easier, or tougher, depending on the case. Below, you will see a list of five decorators present in Java that you didn’t even realize they were decorations. java.util.Collections.synchronizedList(List list) Java 8 provides many synchronizedX() methods, for lists, sets, maps, etc. They are analog.

Read More