Quantcast
Channel: About Me
Browsing latest articles
Browse All 768 View Live

Log4j2 – Delete Old Logs on Rollover

Learn to configure 'Delete' action with RollingFileAppender and DefaultRolloverStrategy which will delete the old logs after a certain time. The post Log4j2 – Delete Old Logs on Rollover appeared first...

View Article


Guide to RSocket using Spring Boot

Learn the RSocket protocol and implement communication models in Spring boot using reactive types such as Mono and Flux with examples. The post Guide to RSocket using Spring Boot appeared first on...

View Article


Spring @RSocketExchange with Example

Since version 6, Spring supports creating an RSocket service as a Java interface with @RSocketExchange annotated methods for TCP exchanges. The post Spring @RSocketExchange with Example appeared first...

View Article

Spring Boot – PartEvent API to Stream Multipart Form Uploads

Learn to use Spring PartEvent API for streaming multipart requests to a webflux controller and handle the form parameters and file contents. The post Spring Boot – PartEvent API to Stream Multipart...

View Article

Builder Pattern for Java Records

Learn to implement the builder pattern style fluent API and copy constructors in Java records for creating immutable records with examples. The post Builder Pattern for Java Records appeared first on...

View Article


Mask a String Except Last 4 Chars in Java

Learn to mask a string or number with a mask character except the last 4 characters at the end, e.g., in account numbers and SSN. The post Mask a String Except Last 4 Chars in Java appeared first on...

View Article

Check If a File Exists in Python

Learn to use the Python os.path and pathlib modules to check if a file exists at the specified path, and it is a regular file with examples. The post Check If a File Exists in Python appeared first on...

View Article

JMH ERROR: Unable to find the resource: /META-INF/BenchmarkList

The JMH error "Unable to find the resource: /META-INF/BenchmarkList" is mostly observed when we do not configure the compiler plugin. The post JMH ERROR: Unable to find the resource:...

View Article


Convert a String Array to Integer Array in Java

Learn to convert a specified array of strings to an array of int or Integer values using Java 8 Streams and learn to handle invalid values. The post Convert a String Array to Integer Array in Java...

View Article


Connect to MySQL / PostgreSQL Running in Docker Container

Learn to install the database services such as MySQL and PostgreSQL as docker containers and connect to them from Adminer or Spring boot app. The post Connect to MySQL / PostgreSQL Running in Docker...

View Article

Spring Boot – Separate DataSource for Test, Dev and Prod

Learn to configure and use different DataSource in different environments (test, development, production etc.) using the Spring profile specific properties files, as well as Java configuration in a...

View Article

Java – Convert Instant to LocalDateTime, LocalDate or LocalTime

Learn to convert a given Instant to LocalDateTime, LocalDate, or LocalTime instances in the current system timezone or a specified timezone in Java. 1. Difference between Instant and LocalDateTime An...

View Article

Convert Instant to ZonedDateTime in Java

Learn to convert a specified Instant (in UTC) to ZonedDateTime (at some zone), and ZonedDateTime to Instant with easy-to-follow Java examples. The post Convert Instant to ZonedDateTime in Java appeared...

View Article


Generate Random Numbers in a Range in Java

Learn to generate random numbers (ints, floats) in a range using new methods added in Java 8 in Random, SecureRandom and ThreadLocalRandom. The post Generate Random Numbers in a Range in Java appeared...

View Article

List of Zone Ids and Zone Offsets in Java

Learn about the available zone ids and zone offsets in Java 8 or later. These zone ids and offsets represent an instant/timestamp that is local to the specified timezone. 1. Using ZoneId and ZoneOffset...

View Article


Handle Exceptions Thrown in Java Streams

Learn to handle the checked exceptions thrown from the methods used in Stream operations in Java 8 using safe method extraction and Optional. The post Handle Exceptions Thrown in Java Streams appeared...

View Article

Convert a Primitive Array to List in Java

Learn to convert an array of primitives (int, long, float, double) to a List in Java using the iteration, Streams and open-source libraries. The post Convert a Primitive Array to List in Java appeared...

View Article


[Solved] Spring Boot H2 – Schema not found

Learn to solve the 'JdbcSQLSyntaxErrorException schema not found' error in a Spring boot app that uses the H2 database for CRUD operations. The post [Solved] Spring Boot H2 – Schema not found appeared...

View Article

[Solved] Java class file has wrong version 61.0

Learn to solve the Java compiler exception "Java class file has wrong version" while migrating an application to Spring 6 or Spring boot 3. The post [Solved] Java class file has wrong version 61.0...

View Article

JPAstreamer – JPA Entities as Java Stream in Spring Boot

JPAstreamer helps in fetching and processing the JPA or hibernate entities in the same way as we process the POJOs using Java 8 Stream API. The post JPAstreamer – JPA Entities as Java Stream in Spring...

View Article
Browsing latest articles
Browse All 768 View Live