This is a Spring Boot 🌱 project designed to work with reactive web applications ♻️ and supports two databases: PostgreSQL 🐘 and Cassandra 🗄️. Users can configure the application to use either database as per their requirements. The project leverages modern Java ☕ features and frameworks like WebFlux ♻️ and R2DBC for reactive programming ⚡.
- ⚡ Reactive programming with WebFlux ♻️.
- 📊 Support for PostgreSQL 🐘 and Cassandra 🗄️ databases.
- 🛠️ Built with Java 21 ☕.
- 🖥️ Ready for native image compilation using GraalVM.
Before running the application, ensure you have the following installed:
- Java Development Kit (JDK) 21 ☕ or higher.
- PostgreSQL database 🐘 (if using PostgreSQL).
- Cassandra database 🗄️ (if using Cassandra).
- Docker (optional, for containerized database setup).
- Maven or Gradle for dependency management.
git clone https://github.com/Jaxongirshoh/reactivespringapp.git
cd reactivespringapp
gradle build
- Update the
application.yml
orapplication.properties
file:
spring:
r2dbc:
url: r2dbc:postgresql://localhost:5432/your_database
username: your_username
password: your_password
- Ensure the PostgreSQL database is running. You can use Docker to set up a PostgreSQL instance:
docker run --name postgres-db -e POSTGRES_USER=your_username -e POSTGRES_PASSWORD=your_password -e POSTGRES_DB=your_database -p 5432:5432 -d postgres
- Update the
application.yml
orapplication.properties
file:
spring:
data:
cassandra:
contact-points: localhost
port: 9042
keyspace-name: your_keyspace
username: your_username
password: your_password
- Ensure the Cassandra database is running. You can use Docker to set up a Cassandra instance:
docker run --name cassandra-db -e CASSANDRA_KEYSPACE=your_keyspace -p 9042:9042 -d cassandra
To run the application locally, use:
gradle bootRun
The application will start on http://localhost:8080
by default.
Run the test suite using:
gradle test
If you wish to build a native image using GraalVM:
gradle nativeCompile
Contributions are welcome! Please fork the repository and create a pull request for any changes or improvements.
This project is licensed under the MIT License.
For questions or support, connect with me on LinkedIn! 😊
Check out my projects on GitHub!