Skip to content
This repository has been archived by the owner on Oct 29, 2021. It is now read-only.

Kafka Streams application to compute alarm state in JAWS

License

Notifications You must be signed in to change notification settings

JeffersonLab/alarm-state-processor

Repository files navigation

alarm-state-processor Java CI with Gradle Docker

A Kafka Streams application to compute alarm state and output to the alarm-state topic in JAWS given registered-alarms, active-alarms, and overridden-alarms topics.



Quick Start with Compose

  1. Grab project
git clone https://github.com/JeffersonLab/alarm-state-processor
cd alarm-state-processor
  1. Launch Docker
docker-compose up
  1. Set an override
docker exec jaws /scripts/client/set-overridden.py --override Disabled alarm1
  1. Verify state
docker exec state  /opt/alarm-state-processor/bin/list-state.sh

Build

This Java 11 project uses the Gradle 6 build tool to automatically download dependencies and build the project from source:

git clone https://github.com/JeffersonLab/alarm-state-processor
cd alarm-state-processor
gradlew build

Note: If you do not already have Gradle installed, it will be installed automatically by the wrapper script included in the source

Note: Jefferson Lab has an intercepting proxy

Note: When developing the app you can mount the build artifact into the container by substituting the docker-compose up command with:

docker-compose -f docker-compose.yml -f docker-compose-dev.yml up

Configure

Runtime Environment Variables

Name Description
BOOTSTRAP_SERVERS Comma-separated list of host and port pairs pointing to a Kafka server to bootstrap the client connection to a Kafka Cluser; example: kafka:9092
SCHEMA_REGISTRY URL to Confluent Schema Registry; example: http://registry:8081

Deploy

The Kafka Streams app is a regular Java application, and start scripts are created and dependencies collected by the Gradle distribution targets:

gradlew assembleDist

Releases

Launch with:

UNIX:

bin/alarm-state-processor

Windows:

bin/alarm-state-processor.bat

Docker

docker pull slominskir/alarm-state-processor

Image hosted on DockerHub