Giter Club home page Giter Club logo

jaws-registrations2epics's Introduction

jaws-registrations2epics CI Docker Image Version (latest semver)

A Kafka Streams application to continuously populate the epics2kafka epics-channels topic from the JAWS alarm-instances topic for the subset of messages containing source type EPICSSource.



Overview

This app keeps epics2kafka automatically configured based on the JAWS configuration. This Kafka Streams app consumes the alarm-instances topic and looks for registration messages related to EPICS and for each of those produces a command message to epics2kafka via the epics-channels topic.

When a JAWS registration is removed it is removed via a tombstone message, which is a null value for a given key. This presents a challenge as a registration removal does not have a value payload to indicate whether it is an EPICS registration or what is the PV/channel name. The epics2kafka epics-channels topic key contains a PV/channel whereas the JAWS alarm-instances key is an alarm name. To overcome this challenge this app is not stateless, it uses a Kafka Streams store to track all JAWS registration records that have been used to command epics2kafka. This way the registration record key, the alarm name, can be used in the tombstone case to lookup if the tombstone means action is needed.

Quick Start with Compose

  1. Grab project
git clone https://github.com/JeffersonLab/jaws-registrations2epics
cd jaws-registrations2epics
  1. Launch Compose
docker compose up
  1. Monitor the epics-channels command topic for updated channels to monitor
docker exec kafka kafka-console-consumer.sh --bootstrap-server kafka:9092 --topic epics-channels --from-beginning --property "print.key=true" --property "key.separator==" 
  1. Register an alarm
docker exec -it jaws set_instance alarm1 --pv channel1 

See: Docker Compose Strategy

Install

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

Download from Releases or build yourself.

Start scripts are created and dependencies collected by the Gradle distribution target:

gradlew assembleDist

Launch with:

UNIX:

bin/jaws-regisrations2epics

Windows:

bin/jaws-registrations2epics.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

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/registrations2epics
cd registrations2epics
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

Release

  1. Bump the version number in build.gradle and commit and push to GitHub (using Semantic Versioning).
  2. Create a new release on the GitHub Releases page corresponding to same version in build.gradle (Enumerate changes and link issues). Run dist build and attach zip to release.
  3. Publish to DockerHub GitHub Action should run automatically.
  4. Bump and commit quick start image version after confirming new image works

See Also

jaws-registrations2epics's People

Contributors

slominskir avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

jaws-registrations2epics's Issues

Quick start topic epics-channels

Since switching to bitnami Kafka container the CREATE_TOPICS env is no longer honored:

CREATE_TOPICS: 'epics-channels:1:1:compact'

The quick start now shows a WARNING (but ultimately works as topic is auto-created).

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.