Home » Tag Archives: Spring (page 5)

Tag Archives: Spring

DataSource Routing with Spring @Transactional

spring-interview-questions-answers

I was inspired by Carl Papa’s use of aspects with the Spring Framework to determine the DataSource to use (either read-write or read-only). So, I’m writing this post. I must admit that I have long been familiar with Spring’s AbstractRoutingDataSource. But I did not have a good idea where it can be used. Thanks to Carl and team, and one ...

Read More »

Power Up Your Data Model With Projections

spring-interview-questions-answers

Introduction Data models can be tricky. Modelling can be even harder. Sometimes information that should go into a database table isn’t necessarily what we want to go out to every piece of code. And like so many other times, Spring comes to the rescue. A little feature called projection helps us to map data with only a few lines in ...

Read More »

Spring Webflux – Writing Filters

spring-interview-questions-answers

Spring Webflux is the new reactive web framework available as part of Spring 5+.  The way filters were written in a traditional Spring MVC based application(Servlet Filter, HandlerInterceptor) is very different from the way a filter is written in a Spring Webflux based application and this post will briefly go over the WebFlux approach to Filters. Approach 1 – WebFilter The first ...

Read More »

Difference between @Component, @Service, @Controller, and @Repository in Spring

spring-interview-questions-answers

Before you learn the difference between @Component, @Service, @Controller, and @Repository annotations in Spring framework, it’s important to understand the role of @Component annotation in Spring. During initial release of Spring, all beans are used to be declared in an XML file. For a large project, this quickly becomes a massive task and Spring guys recognize the problem rather quickly. ...

Read More »

Intro to Redis with Spring Boot

1. Overview In this article, we will review the basics of how to use Redis with Spring Boot through the Spring Data Redis library. We will build an application that demonstrates how to perform CRUD operations Redis through a web interface. The full source code for this project is available on Github. 2. What is Redis? Redis is an open ...

Read More »

Spring boot and Apache Camel

As the world of software moves on, more complex systems are being developed, which have to integrate with each other. It started with SOA and it continues with microservices. Camel is the number one integration tool that comes to my mind since nowadays spring boot with camel is a very strong combination.               The ...

Read More »

Using Micrometer with Spring Boot 2

spring-interview-questions-answers

This is a very quick introduction to using the excellent Micrometer library to instrument a Spring Boot 2 based application and recording the metrics in Prometheus Introduction Micrometer provides a Java based facade over the client libraries that the different monitoring tools provide. As an example consider Prometheus, if I were to integrate my Java application with Prometheus, I would have used ...

Read More »