Spring Boot Structured Logging in JSON Format Example
Since version 3.4, Spring Boot will provide native support for structured logging in the most common and popular formats, such as JSON and XML.
Since version 3.4, Spring Boot will provide native support for structured logging in the most common and popular formats, such as JSON and XML.
1. Problem When writing tests that depend on H2 database in a Spring boot application, we may encounter the CommandAcceptanceException: Error executing DDL. The root cause exception will be org.h2.jdbc.JdbcSQLSyntaxErrorException in the logs. The exception stack trace will look something like this: If you are trying to run unit tests …
Learn to create a REST API controller using @RestController in a Spring Boot application, and add method validation, error handling and unit tests.
Learn to Spring Data JPA module and work with JpaRepository interface for performing the CRUD operations in underlying databases in a Spring Boot application.
Learn to write Spring Boot RESTs that help in downloading the Excel files (.xlsx) either stored in the server or generating and then sending it.
Learn to create generic and custom error pages for specific HTTP error codes in a Spring Boot application with configuration examples.
By leveraging Spring @Import and @ImportResource annotations, we can create more modular, maintainable, and flexible Spring Boot applications.
Spring Boot provides various ways to load property files such as default application.properties, spring profiles, custom property files, environment variables, and system properties.
Learn to create a Spring Boot project with Gradle from scratch, configure the build script, create a Spring Boot application class, and run the application.
In Spring tutorial explores transaction-aware caching using transactionAware property and TransactionAwareCacheManagerProxy class with example.
This guide explores the step-by-step process of containerization and running a Spring Boot application with PostgreSQL database using Podman.
Learn to handle REST API timeouts on the server side using Spring boot MVC async, Resilience4j, @Transactional, RestTemplate and WebClient with examples.
Learn to display images from different sources (e.g., resources directory or database) using the Thymeleaf view templates in a Spring Boot application.
Spring Boot is an open-source framework that simplifies the development of stand-alone, production-grade Spring-based MVC applications and microservices.
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.
Learn to create a Kafka Streams application using Spring Boot. Also, learn about Topology and Processor and unit test the topology design.
Learn to write a REST API in Spring Boot that can handle single file and multiple file uploads. Also learn to validate the file sizes and types.
Learn to configure the logging levels for different packages and classes in a Spring boot application using properties, YAML and XML configurations.
Learn to build REST APIs in a Spring boot application with request validation, error handling, testing and API documentation with examples.
Learn to configure Spring boot application and Apache Kafka Producer, and Consumer, handle Kafka errors and retry in case of failures.
Learn to design and implement a Spring Boot REST API that accepts long-running tasks and publishes the execution progress to a Kafka topic.
Learn to call OpenAI ChatGPT APIs in Spring Boot RestTemplate or WebClient with an example. Also, log the requests and responses for debugging.
Learn the most common solutions for the Spring boot application closing automatically after start, with exit code 0 and no exceptions logs.
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.
Learn to use Spring boot docker compose module, customize the compose file and container lifecycle with an example.
Learn to use integrate DynamoDB using Spring-cloud-aws module and its DynamoDbTemplate and DynamoDbEnhancedClient beans with examples.
Step by step, we will learn to deploy a Spring Boot application to AWS Elastic Beanstalk which uses RDS for persisting the records in the database.
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 …
Learn to use the test container library (KeycloakContainer) to start keycloak server as a docker container while unit testing with JUnit and Spring boot.
This Spring security tutorial discusses using Keycloak and Spring Security OAuth2 to implement token-based authentication in a spring boot app.
Learn to configure bulkhead and rate limiting using Resilience4j 2 in a Spring boot 3 application, and testing with Apache JMeter.
Spring boot, by default, configures Jackson for parsing objects to JSON. We can use Jackson’s XML module or JAXB to configure the XML support.
Learn to execute SQL scripts to load data (e.g. import.sql, schema.sql or data.sql) during startup of a Spring boot application or tests.
Learn to access DynamoDB from a Spring Boot app and perform CRUD, batch and transaction operations using DynamoDBMapper or JPA Repository.
Learn to create an application from scratch using REST APIs created with Spring boot and the user interface created with Vue.js. We will build a simple employee management application with Create, Read, Update, and Delete (CRUD) functionality. 1. Application Overview In the application, the home screen will present a list …
Learn to solve the ‘JdbcSQLSyntaxErrorException schema not found’ error in a Spring boot app that uses the H2 database for CRUD operations.
In this post, we will learn how to configure and manage multiple datasources using properties configuration and defining custom beans using Java annotations in Spring Boot. Note that this requirement differs from having separate datasource in test, dev and prod environments. Here, we are using multiple datasources in the same …
Learn the internal working of SpringBootServletInitializer and how to use it to deploy a Spring Boot application to an external server.
Learn to Spring Boot API to accept multiple file uploads, store in a folder, save file details in database and build a React UI to interact.
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 Spring boot application. 1. Introduction A production grade application is deployed and tested in different environments before finally released to the end-user. …
Learn to perform integration testing using Testcontainers and JUnit 5 in a Spring boot application, including creating a @ServiceConnection.
Learn to create Spring boot API to handle MultipartFile request to upload files and invoking such API from the Angular using example.
Learn to use Spring PartEvent API for streaming multipart requests to a webflux controller and handle the form parameters and file contents.
Learn to configure and deploy a Spring Boot application as a traditional .war file into an external tomcat application server.
Since version 6, Spring supports creating an RSocket service as a Java interface with @RSocketExchange annotated methods for TCP exchanges.
Learn the RSocket protocol and implement communication models in Spring boot using reactive types such as Mono and Flux with examples.
Learn how to enable SQL logging in a Spring boot Data JPA application, print SQL statements and prepare statements with parameter values.
Learn to configure MyBatis with Spring Boot 3 and configure @Mapper and DataSource. Also, learn mapper scanning with @MapperScan with example.
Learn the core concepts of GraphQL and running an example Spring Boot application with GraphQL integrated for querying and updating the data.
This JHipster tutorial will familiarize you with this popular code generation platform and work with front-end and backend generated code.
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.