Home » Spring

Tag Archives: Spring

Composing custom annotations with Spring

spring-interview-questions-answers

Java Annotations were introduced with Java 5 back in 2004 as a way to add meta data into Java source code. Today many major frameworks like Spring or Hibernate heavily rely on annotations. In this post we will have a look at a very useful Spring feature which allows us to create our own annotations based on one or more ...

Read More »

Using Websocket with Spring Framework and Vuejs

spring-interview-questions-answers

Websockets are full duplex (persistent) connections between client and server such that both can share information with each other without the need for repeatedly establishing a new connection. This removes the need for repeated polling from the client to get updates from the server. Not all browsers support Websockets and hence we make use of SockJS javascript library to create ...

Read More »

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 »