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 MoreSpring 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 MoreSpring 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 MoreYour 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 More5 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 More4 rules to write deadly fast and efficient unit tests in Java with Mockito
Unit testing in OOP is the test of the smallest testable piece of code: the class. It’s used to make sure a single class does what it’s supposed to do. After some years of experience, I got to see unit testing as a crucial part of the software development process, since they give me some important advices that I couldn’t identify before writing them. Not being able to write a good and simple unit test might be a sign of code smell, advising you that your code is too coupled or …
Read MoreLombok Constructors
In the post Lombok Getters and Setters, we talked about the use of Lombok to provide quick and easy getters and setters. In this post, I will cover another great feature from Lombok, that provides quick and easy constructors. For this post, I will use Lombok v1.16.16.
Read MoreLombok Getters and Setters
If you are a starter developer, this post is for you. Who has never got fed up with all the generic purpose getters and setters we need to write? Even with the functionalities IDEs provide to automate it, we still have that amount of redundant code written in the classes.
Read MoreBookStore WebServices
In this post I will explain step-by-step how to create a simple BookStore with RESTful WebServices. This code is also available in my GitHub page. Feel free to comment if you have any doubt or suggestion. 😄
Read MoreSimple String Generator
It’s usually necessary to have a way to produce random strings programmatically: Produce random IDs for entities; Produce random passwords; Produce random patterns, etc. Today, I will show you a very quick way to create those strings for studying purpose or as a simple solution.
Read More