Sign inSign up

jujuwry/kafkaflightpredictor

By jujuwry

•Updated over 1 year ago

Spring Boot app that fetches real-time flight data from AviationStack API, and ML to predict status

Image
0

242

jujuwry/kafkaflightpredictor repository overview

cat < README.md

⁠Kafka Flight Predictor

This is a Spring Boot application that integrates with Kafka and the AviationStack API to provide flight-related predictions or data processing. It uses WebFlux for reactive programming and caching with Caffeine.

⁠Prerequisites

  • Docker: Ensure Docker is installed to run the container.
  • API Key: Obtain an API key from AviationStack⁠ to access flight data.
  • Kafka: A running Kafka instance (e.g., localhost:9092) is required for message processing.

⁠Running the Container

⁠Pull the Image

```bash docker pull jujuwry/kafkaflightpredictor:latest ```

⁠Configure Environment Variables

The application requires an .env file or environment variables for configuration. Create an .env file with the following structure:

``` aviationstack.api.key=YOUR_AVIATIONSTACK_API_KEY spring.kafka.bootstrap-servers=localhost:9092 kafka.topic.flights=flight-details spring.kafka.consumer.group-id=flight-consumer-group spring.kafka.consumer.properties.spring.json.trusted.packages=com.george.model ```

Replace YOUR_AVIATIONSTACK_API_KEY with your actual AviationStack API key.

⁠Run the Container

Mount the .env file or pass environment variables directly:

⁠With .env File

```bash docker run -p 8080:8080 -v /path/to/.env:/app/.env jujuwry/kafkaflightpredictor:latest ```

⁠With Environment Variables

```bash docker run -p 8080:8080 \ -e "aviationstack.api.key=YOUR_AVIATIONSTACK_API_KEY" \ -e "spring.kafka.bootstrap-servers=localhost:9092" \ -e "kafka.topic.flights=flight-details" \ -e "spring.kafka.consumer.group-id=flight-consumer-group" \ -e "spring.kafka.consumer.properties.spring.json.trusted.packages=com.george.model" \ jujuwry/kafkaflightpredictor:latest ```

⁠Access the Application
  • The app runs on port 8080. Access it at http://localhost:8080.

⁠Configuration Notes

  • API Key: The aviationstack.api.key is a placeholder in the image. You must provide your own key, as the original key is not included for security.
  • Kafka: Adjust spring.kafka.bootstrap-servers and kafka.topic.flights to match your Kafka setup.

⁠Building Locally (Optional)

If you want to build the image yourself:

  1. Clone the repo (if available) or use the Dockerfile.
  2. Run: ```bash mvn clean package docker build -t jujuwry/kafkaflightpredictor:latest . ```

Tag summary

Content type

Image

Digest

sha256:4ac03d366…

Size

345 MB

Last updated

over 1 year ago

docker pull jujuwry/kafkaflightpredictor