# Redis distributed lock service
## Overview
The Redis distributed lock service is a Spring Boot application designed to handle transaction-related operations. It
uses PostgreSQL for data persistence and Redis for locking.
## Technologies Used
- Java
- Spring Boot
- Gradle
- PostgreSQL
- Redis
- Reactor (for reactive programming)
## Prerequisites
- Java 17 or higher
- Gradle 7.0 or higher
- Docker and Docker Compose
## Getting Started
### Clone the Repository
```sh
git clone https://github.com/Kushchii/redis-distributed-lock.git
cd redis-distributed-lock
./gradlew build
Ensure Docker and Docker Compose are installed on your machine. To start the services, run:
docker-compose up
This will start the following services:
postgres_1
: PostgreSQL databaseredis_data
: Redis
To run the application locally, use:
./gradlew bootRun
- URL:
/api/transactions
- Method:
POST
- Request Body:
{ "id": "string", "amount": "number", "userId": "string", "currency": "string", "status": "string", "description": "string" }
- Response:
{ "message": "Transaction saved successfully" }
- URL:
/api/callback
- Method:
POST
- Request Body:
{ "id": "string", "status": "string" }
- Response:
{ "message": "Callback processed successfully" }