Home » Tag Archives: Spring

Tag Archives: Spring

Advanced profile management in Spring Boot

spring-interview-questions-answers

We all are aware of profile management in Spring Boot and the flexibility it provides in configuring our applications for different environments. The other powerful aspect of this is that at any given time we can have multiple active profiles. The advantage this gives is that we can mix the deployment environment profile along with business use case related profiles. ...

Read More »

Method parameter validation with Spring and JSR 303

spring-interview-questions-answers

Spring provides an easy way to validate method parameters using JSR 303 bean validation. In this post we will see how to use this feature. Setup First we need to add support for method parameter validation by creating a MethodValidationPostProcessor bean: 1 2 3 4 5 6 7 @Configuration public class MyConfiguration {     @Bean     public MethodValidationPostProcessor methodValidationPostProcessor() {         return new MethodValidationPostProcessor();     } } Validating method parameters After registering ...

Read More »

Send your data async on Kafka

spring-interview-questions-answers

For a project, I’m trying to log the basic transactions of the user such as addition and removal of an item and for multiple types of items and sending a message to kafka for each transaction. The accuracy of the log mechanism is not crucial and I don’t want it to block my business code in the case of kafka ...

Read More »

Project reactor – de-structuring a Tuple

spring-interview-questions-answers

Tuples are simple data structures that hold a fixed set of items, each of a different data type. Project Reactor provides a Tuple data structure that can hold about 8 different types. Tuples are very useful, however one of the issues in using a Tuple is that it is difficult to make out what they hold without de-structuring them at ...

Read More »

Better integration tests with WireMock

spring-interview-questions-answers

No matter if you follow the classical test pyramid or one of the newer approaches like the Testing Honeycomb you should start writing integration tests at some point during development.There are different types of integration tests you can write. Starting with persistence tests, you can check the interaction between your components or you can simulate calling external services. This article ...

Read More »

Spring MVC – HTTP message converter

Quite often you need to provide users with the same data, but in different forms, like JSON, PDF, XLS, etc. If your application is Spring Framework based, this task can be achieved using HTTP message converters. HTTP message converters are applied when HTTP request (or its parts) needs to be converted into type required for handler method argument (see: Handler ...

Read More »