Skip to content

Commit

Permalink
feat: logging level and readme
Browse files Browse the repository at this point in the history
  • Loading branch information
farneser committed Nov 26, 2023
1 parent 0c02eb3 commit e6d66e5
Show file tree
Hide file tree
Showing 3 changed files with 59 additions and 3 deletions.
56 changes: 54 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,55 @@
# task-tracker-scheduler
# Task Tracker Scheduler Service

Scheduler module for Task tracker
The Task Tracker Scheduler Service is a microservice designed to handle scheduled tasks, leveraging Spring Boot with
Kotlin, JPA for data persistence, and RabbitMQ for efficient message queuing. This service focuses on collecting
statistics related to tasks and sending them to RabbitMQ for further processing.

## Features

* Task Scheduling: Utilizes cron expressions to schedule recurring tasks efficiently.
* Message Queue Integration: Utilizes RabbitMQ to send collected statistics as messages for asynchronous processing.
* Spring Boot with Kotlin: Employs the power of Spring Boot framework and Kotlin language to build a robust and concise
microservice.

## Prerequisites

Make sure you have the following installed:

* Java (JDK 17 or higher)
* Kotlin
* Postgres
* RabbitMQ

## Building the Service

To build the service, run the following commands:

```bash
git clone https://github.com/farneser/task-tracker-scheduler
cd task-tracker-scheduler
./mvnw clean package
```

## Running the Service

Use this service in stack with the other [Task Tracker microservices](https://github.com/farneser/task-tracker)

## Docker

Service images are available on [Docker Hub](https://hub.docker.com/r/farneser/task-tracker-scheduler)

## Environment Variables

| Variable Name | Default value | Description |
|-------------------|---------------|-------------------------------------------------|
| POSTGRES_HOST | localhost | PostgreSQL database host |
| POSTGRES_PORT | 5432 | PostgreSQL database port |
| POSTGRES_DB | task-tracker | PostgreSQL database name |
| POSTGRES_USERNAME | postgres | PostgreSQL database username |
| POSTGRES_PASSWORD | postgres | PostgreSQL database password |
| RABBITMQ_HOST | localhost | RabbitMQ host |
| RABBITMQ_PORT | 5672 | RabbitMQ port |
| RABBITMQ_USERNAME | rabbitmq | RabbitMQ username |
| RABBITMQ_PASSWORD | rabbitmq | RabbitMQ password |
| SCHEDULER_CRON | 0 0 0 * * * | Scheduler cron expression (default at midnight) |
| LOG_LEVEL | INFO | Spring application logging level |
3 changes: 2 additions & 1 deletion src/main/resources/application-dev.properties
Original file line number Diff line number Diff line change
Expand Up @@ -15,5 +15,6 @@ spring.rabbitmq.password=rabbitmq
# scheduler
# every minute
scheduler.cron=0 * * * * *

# spring
logging.level.root=DEBUG

3 changes: 3 additions & 0 deletions src/main/resources/application.properties
Original file line number Diff line number Diff line change
Expand Up @@ -13,4 +13,7 @@ spring.rabbitmq.port=${RABBITMQ_PORT:5672}
spring.rabbitmq.username=${RABBITMQ_USERNAME:rabbitmq}
spring.rabbitmq.password=${RABBITMQ_PASSWORD:rabbitmq}
# scheduler
# default at midnight
scheduler.cron=${SCHEDULER_CRON:0 0 0 * * *}
# spring
logging.level.root={LOG_LEVEL:INFO}

0 comments on commit e6d66e5

Please sign in to comment.