Skip to content
Advertisement

Tag: spring

How to deserialize BigDecimal value received from kafka broker through debezium CDC mechanism?

I have a couple of microservices developed using spring boot and each has its own Postgres database. These microservices exchange data with a CDC mechanism provided by debezium platform through kafka broker and kafka connect. I have a microservice A that stores some entities with a BigDecimal attribute. Another microservice B depends on the data stored by A so it

Dynamically add property sources to SpringBootTest

Similar to Springboot unit test set @Configuration Properties dynamically but the context is different. In my case I have a TestContainer running a custom MySQL database that is prepopulated with a lot of data (not using the SQL batch loading approach because the data is an anonymized copy of production and doing it through SQLs makes the boot up time

Spring Boot graceful shutdown

I am developing a Spring Boot application backed by embedded Tomcat and I need to develop a graceful shutdown with the following steps: stop processing new HTTP requests (stop web container) process all already accepted requests shutdown Spring ApplicationContext *do the steps above sequentially (one by one) How can I achieve this? P.S. Spring Boot 1.5.20.RELEASE, Java 8 Answer I

Route order in Spring Cloud Gateway

We are implementing routes programmatically using a implementation of RouteDefinitionLocator. We have two services which should register at the same route path, where one of them is meant as a fallback if the other one does not exist. The preferred route with the specific path is: And the more general one, which should only fire if other route was found:

How to catch deserialization error in Kafka-Spring?

I’m getting up an application consuming kafka messages. I followed Spring-docs about Deserialization Error Handling in order to catch deserialization exception. I’ve tried the failedDeserializationFunction method. This is my Consumer Configuration Class This is the BiFunction Provider When I send just one corrupted message on the topic I got this error (in loop): org.apache.kafka.common.errors.SerializationException: Error deserializing key/value I understood that

Advertisement