Skip to content

JeffersonLab/jaws-effective-processor

Repository files navigation

jaws-effective-processor CI Docker

A set of connected Kafka Streams apps for JAWS that process alarm registration and notification data and compute effective state.

Read more about Overrides and Effective State and Software Design.



Quick Start with Compose

  1. Grab project
git clone https://github.com/JeffersonLab/jaws-effective-processor
cd jaws-effective-processor
  1. Launch Compose
docker compose up
  1. Monitor for expiration tombstone message
docker exec -it jaws list_overrides --monitor 
  1. Shelve an alarm for 5 seconds
docker exec jaws set_override --override Shelved alarm1 --reason Other --expirationseconds 5

See: More Usage Examples

Install

This application requires a Java 11+ JVM and standard library to run.

Download from Releases or build the distribution yourself.

Launch with:

UNIX:

bin/jaws-effective-processor

Windows:

bin/jaws-effective-processor.bat

Configure

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
STATE_DIR Directory where local Kafka Streams state is stored [1], [2]. Defaults to java.io.tmp system property value with an appended subdir named kafka-streams.

Build

This project is built with Java 17 (compiled to Java 11 bytecode), and uses the Gradle 7 build tool to automatically download dependencies and build the project from source:

git clone https://github.com/JeffersonLab/jaws-effective-processor
cd jaws-effective-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 for JLab On-Site Users: Jefferson Lab has an intercepting proxy

See: Docker Development Quick Reference

Develop

In order to iterate rapidly when making changes it's often useful to run the app directly on the local workstation, perhaps leveraging an IDE. In this scenario run the service dependencies with:

docker compose -f deps.yaml up

Then run the app with:

gradlew run

Note: The STATE_DIR config is set to the gradle build dir such that running a clean task will clear the local state. You may need to reset the Kafka server state after running a clean task by restarting Kafka from scratch else using the Reset Tool.

Note: Javadocs can be generated with the command:

gradlew javadoc

Release

  1. Bump the version number in the VERSION file and commit and push to GitHub (using Semantic Versioning).
  2. The CD GitHub Action should run automatically invoking:
    • The Create release GitHub Action to tag the source and create release notes summarizing any pull requests. Edit the release notes to add any missing details. A zip file artifact is attached to the release.
    • The Publish docker image GitHub Action to create a new demo Docker image.

See Also