Skip to content

USSD Event Processor that monitors directories for call detail record files, processes them, and stores data in a PostgreSQL database.

Notifications You must be signed in to change notification settings

Phinart98/file-loader-service

Repository files navigation

USSD Event Processor - File Loader Service

This application monitors a directory for USSD event files and loads them into a PostgreSQL database.

Prerequisites

  • Java 21
  • Docker and Docker Compose (Optional)
  • IntelliJ IDEA or VS Code with Spring Boot plugins/extensions

Quick Start

1. Clone the repository

git clone https://github.com/Phinart98/file-loader-service.git
cd file-loader-service

2. Start the database

docker-compose up -d

This starts:

3. Configure Input Directory

The application is configured to monitor a specific directory for new files. You have two options:

Option A: Use the Sample Data (Recommended for Testing)

  1. Create directories for input and processed files:
mkdir -p C:/ussd/input C:/ussd/processed
  1. Copy sample files to the input directory:
cp sample-data/input/* C:/ussd/input/

Option B: Configure Custom Directories

Edit src/main/resources/application.properties to set your preferred directories:

file.monitoring.directory=YOUR_INPUT_DIRECTORY_PATH
file.monitoring.processed-directory=YOUR_PROCESSED_DIRECTORY_PATH

4. Run the application

Open the project in your IDE (IntelliJ IDEA or VS Code) and run the application directly.

The application will:

  • Connect to the PostgreSQL database
  • Monitor the configured directory for new files
  • Process files and load records into the database

5. Access pgAdmin

  • Open http://localhost:5050 in your browser
  • Login with:
  • Create a new server connection:
    • Name: Any name you want
    • Host: localhost (or postgres if inside Docker network)
    • Port: 5432
    • Username: postgres
    • Password: postgres

6. Process files

Place USSD log files in the directory configured in application.properties (default: C:/ussd/input).

7. Stop the database

When finished:

docker-compose down

Running without Docker

If you prefer to run the application directly:

  1. Start a PostgreSQL database.
  2. Update application.properties with your database connection details
  3. Run the application directly from your IDE:
    • In IntelliJ: Click the Run button
    • In VS Code: Use the Spring Boot Dashboard to run the application

Configuration

Key settings in application.properties:

  • file.monitoring.directory: Directory to monitor for new files
  • file.monitoring.processed-directory: Directory for processed files
  • file.monitoring.interval: Polling interval in milliseconds (default: 60000)

About

USSD Event Processor that monitors directories for call detail record files, processes them, and stores data in a PostgreSQL database.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages