A new upgrade chapter! This one covers the required changes on the book’s source code to update it to Spring Boot 2.7.1 and some extras.
There are different ways to test your Controller (Web or API Layer) classes in Spring Boot, some provide support to write pure Unit Tests and some others are more useful for Integration Tests. Within this post, I’ll cover the main three test approaches available for Spring: using MockMVC in standalone mode, MockMVC together with SpringRunner, and using SpringBootTest.
This blog post shows you how to configure Spring Kafka and Spring Boot to send messages using JSON and receive them in multiple formats: JSON, plain Strings or byte arrays.
This sample application also demonstrates how to use multiple Kafka consumers within the same consumer group with the @KafkaListener annotation, so the messages are load-balanced. Each consumer implements a different deserialization approach.
Besides, at the end of this post, you will find some practical exercises in case you want to grasp some Kafka concepts like the Consumer Group and Topic partitions.
Setting up a Hello-World Spring Boot application using AMQP with RabbitMQ is quite easy if you go for the basic setup, as many other guides do. However, the configuration is not so straightforward when you get into the serialization setup and want to make use of
@RabbitListener annotations to produce and consume messages in JSON format. Therefore, I’m sharing with you a really simple but more serious approach that those hello-messaging apps, supported with a real-life practical example.
This article covers:
- How to send/publish Java Objects as JSON messages using Spring Boot and RabbitMQ’s
- How to read/consume JSON messages as Java Objects using Spring Boot and RabbitMQ’s
- How to send and receive Java Objects through RabbitMQ using default Java serializer.
In this practical guide, I’ll demonstrate how to use Feature Toggles for different use case scenarios. You’ll learn how to configure your project to use an out-of-the-box feature toggle router: Unleash.
Cucumber is a great framework to create tests using a BDD approach. Unfortunately, the official website doesn’t provide too much documentation, so it might be tricky to set it up. In this post, I’ll show you how to combine Cucumber with Spring Boot using the
cucumber-spring library to leverage Dependency Injection.
The last part of the guide focuses on building end-to-end tests with Cucumber that support eventual consistency. We use the second feature, the Leaderboard, to show how to integrate Awaitility in Cucumber tests with a practical example.