Reactive Interaction Gateway

Reactive Interaction Gateway

  • User Documentation
  • Source Documentation
  • GitHub

›Hacking the Source

Getting Started

  • Intro
  • Tutorial
  • Examples
  • FAQ

Main Concepts

  • Architecture
  • Features
  • Event Format
  • Publishing Events
  • Receiving Events
  • Forwarding Requests
  • User Authorization
  • Distributed Tracing

Advanced Guides

  • API Gateway Management
  • API Gateway Synchronization
  • Avro
  • JWT Blacklisting
  • Azure Event Hubs

RIG in Production

  • Operator's Guide
  • API Documentation
  • Phoenix LiveDashboard
  • Prometheus Metrics
  • HTTPS
  • Scaling

Hacking the Source

  • Developer's Guide

Developer's Guide to the Reactive Interaction Gateway

You'd like to help hacking? Great! To get started, install Elixir and the Mix build tool on your machine. If you use asdf, all you need to do is asdf install. Otherwise, either follow the instructions on the Elixir website, or use kiex to install and manage Elixir runtimes.

With Elixir installed, do this:

  • Install dependencies with mix deps.get
  • Start Phoenix endpoint with mix phx.server

RIG doesn't come with a status website, but if you like to you can check its health endpoint:

$ curl localhost:4000
{"message":"Route is not available"}
$ curl localhost:4010/health
OK

Additional notes:

  • You can run tests with mix test. See CONTRIBUTING.md for more details.
  • When debugging multi-node features, it's helpful to run the (named) nodes in iex sessions using iex --sname nodename -S mix.

Our conventions are documented in guides/architecture/decisions/. See 0001-record-architecture-decisions.md for more details.

Project Layout

Run mix docs to see the source documentation. The module descriptions should make the code structure obvious; if they don't, please open an issue describing what you were looking for but couldn't find. Also, updates to the (source code) documentation are appreciated!

Incrementing Elixir and OTP versions

To have the project use a newer Elixir version, make sure to change the following locations:

  • .travis.yml: Update the Elixir and OTP versions in the .elixir-env section.
  • Dockerfile, aws.dockerfile, smoke_tests.dockerfile: Make sure to change the FROM image tag for both the build image (elixir:...-alpine) as well as the runtime image (erlang:...-alpine). If the Erlang runtime (ERTS) in the runtime image doesn't match the ERTS version in the build image, chances are the built image won't work due to missing libraries. Because of this, it's best to use the most recent versions for both images when upgrading - they should always be compatible.
  • .tool-versions: Again, make sure both the Elixir and the OTP versions match what you have used in the previous steps.

Releasing a new version

  • Increment @rig_version in mix.exs
  • Increment appVersion in the Helm v2 Chart.yaml and Helm v3 Chart.yaml files
  • Update Helm chart README files: install helm-docs and run helm-docs in the root directory
  • Increment image tag in the Kubernetes rig.yaml file
  • In CHANGELOG.md, rename [Unreleased] and add a corresponding link to the bottom of the file
  • Create a signed Git tag either using git -s or by creating a release using the Github UI

Test Tags

We use tags to group tests together. Often, it makes sense to assign more than one tag to a test case.

@tagWhen to use it?
:avroIntegration tests that require a running Avro schema registry.
:kafkaIntegration tests that require a running Kafka broker.
:kinesisIntegration tests that require an active Kinesis stream.
:smokeQuick integration test that is designed to catch obvious integration problems.
← Scaling
  • Project Layout
  • Incrementing Elixir and OTP versions
  • Releasing a new version
  • Test Tags
Docs
IntroGetting Started
Community
User ShowcaseSlackStack Overflow@KevnBadr
More
Star RIG on GitHub
Copyright © 2021 Accenture