Administrator

Lokesh Gupta

Lokesh Gupta is a Java developer with more than 20 years of experience and the founder of HowToDoInJava, which he started in 2012. He has worked on Java and Spring applications at Hewitt Associates, Hughes Systique, Adobe and Bank of America. The site has over 1,600 tutorials on Java, Spring Boot, Hibernate, testing and TypeScript. Every example is run and verified before it is published, and the source code is on GitHub.

Website: https://howtodoinjava.com

Github: https://github.com/lokeshgupta1981/

Twitter: @HowToDoInJAVA

LinkedIn: https://www.linkedin.com/in/lokeshgupta1981/

My Articles:

Decimal to Hexadecimal Conversion: Examples and Java Code

To convert decimal to hexadecimal, divide by 16 repeatedly and read the remainders in reverse, so 269 becomes 10D. See a worked division table, a table of common conversion examples, and the Java one-liners for both directions.

Spring Boot RestClient (with Examples)

Starting Spring Framework 6.1 and Sring Boot 3.2, we can use the Spring RestClient for performing HTTP requests using a fluent and synchronous API. The RestClient works over the underlying HTTP client libraries such the JDK HttpClient, Apache HttpComponents, and others. As the name suggests, RestClient offers the fluent API design …

Creating a Jasper Report with Spring Boot

Learn to create Jasper reports in a Spring boot application, step by step, by configuring JasperReport library, loading the report templates, fill the data into reports and finally export the filled reports into a variety of formats.

Spring Boot Logging Levels Example

Learn to configure the logging levels for different packages and classes in a Spring boot application using properties, YAML and XML configurations.

Spring Boot Role-Based Authentication with AWS Cognito

Spring Security framework supports a wide range of authentication models, and in this tutorial, we will cover OAuth2 authentication using Amazon Cognito. We will walk through a step-by-step guide from creating the user pool in the AWS, adding the app client, and configuring it in the Spring Boot application. 1. …

Apache Kafka using Spring Boot

Learn to configure Spring boot application and Apache Kafka Producer, and Consumer, handle Kafka errors and retry in case of failures.

Using KafkaTemplate with Spring Boot

Learn the basics of KafkaTemplate, configure KafkaTemplate with custom properties, and configure producer and consumer factories with examples.

Spring Boot @ServiceConnection

Since Spring Boot 3.1, @ServiceConnection is used to provide connection details to a remote service that takes precedence over details in the properties file.

Spring Boot Redis with Lettuce vs Jedis: Setup and Pooling

Connect Spring Boot 4 to Redis with Lettuce or Jedis. Compare the two clients, set the spring.data.redis properties and the commons-pool2 pool, use RedisTemplate, StringRedisTemplate and a @RedisHash repository, and test with Testcontainers.

Redis Pub/Sub with Spring Boot Data

Learn to use Redis Pub/Sub with Spring Boot Data, and configure the message publishers and subscribers (listners) for a given channel topic.

WebSecurityConfigurerAdapter Deprecated: Migration Guide

WebSecurityConfigurerAdapter was deprecated in Spring Security 5.7 and removed in 6.0. Replace it with a SecurityFilterChain bean, requestMatchers, a PasswordEncoder bean, WebSecurityCustomizer and @EnableMethodSecurity on Spring Boot 4, with tests.

Deploy a Dockerized Spring Boot App to AWS

By combining the portability and flexibility of Docker containers with AWS’s reliable and scalable infrastructure, we can take our Spring Boot applications to new heights. In this comprehensive guide, we’ll show exactly how to deploy a Dockerized Spring Boot app to AWS ECS from start to finish. 1. Introduction to …

About Us

HowToDoInJava provides tutorials and how-to guides on Java and related technologies.

It also shares the best practices, algorithms & solutions and frequently asked interview questions.