The following was discovered as part of building this project:
For further reference, please consider the following sections:
- Official Gradle documentation
- Spring Boot Gradle Plugin Reference Guide
- Create an OCI image
- Coroutines section of the Spring Framework Documentation
- GraalVM Native Image Support
- Spring Boot Testcontainers support
- Testcontainers R2DBC support Reference Guide
- Testcontainers Kafka Modules Reference Guide
- Spring Data R2DBC
- Spring Data Reactive Redis
- Docker Compose Support
- Spring Reactive Web
- Testcontainers
- Spring Boot Actuator
- Spring Configuration Processor
- Spring for Apache Kafka
The following guides illustrate how to use some features concretely:
- Accessing data with R2DBC
- Messaging with Redis
- Building a Reactive RESTful Web Service
- Building a RESTful Web Service with Spring Boot Actuator
These additional references should also help you:
- Gradle Build Scans – insights for your project's build
- Configure AOT settings in Build Plugin
- R2DBC Homepage
This project contains a Docker Compose file named compose.yaml
.
In this file, the following services have been defined:
- redis:
redis:latest
Please review the tags of the used images and set them to the same as you're running in production.
This project has been configured to let you generate either a lightweight container or a native executable. It is also possible to run your tests in a native image.
If you're already familiar with Spring Boot container images support, this is the easiest way to get started. Docker should be installed and configured on your machine prior to creating the image.
To create the image, run the following goal:
$ ./gradlew bootBuildImage
Then, you can run the app like any other container:
$ docker run --rm netty-native:0.0.1-SNAPSHOT
Use this option if you want to explore more options such as running your tests in a native image.
The GraalVM native-image
compiler should be installed and configured on your machine.
NOTE: GraalVM 22.3+ is required.
To create the executable, run the following goal:
$ ./gradlew nativeCompile
Then, you can run the app as follows:
$ build/native/nativeCompile/netty-native
You can also run your existing tests suite in a native image. This is an efficient way to validate the compatibility of your application.
To run your existing tests in a native image, run the following goal:
$ ./gradlew nativeTest
There are some limitations regarding Native Build Tools and Gradle toolchains. Native Build Tools disable toolchain support by default. Effectively, native image compilation is done with the JDK used to execute Gradle. You can read more about toolchain support in the Native Build Tools here.
Make sure to include a R2DBC Driver to connect to your database.
This project uses Testcontainers at development time.
Testcontainers has been configured to use the following Docker images:
Please review the tags of the used images and set them to the same as you're running in production.