transmit

Transmit

Transmit

Transmit is a program designed for reliable scheduling and transmission of delayed and periodic messages. It is built with a modular architecture and agnostic design, allowing for seamless integration into various deployment environments.

Key Features:

Installation

Standalone binary

Currently, the defined binary application only supports a postgres repository and nats transmitter adapters. It is hence required that these are running and accessible on the host and ports defined in your provided configuration file.

For convenience, these dependencies are provided in the ./docker-compose.yaml file at the root of the repository.

# Checkout the repository.
git checkout https://github.com/kasbuunk/transmit
cp transmit

# Run dependencies (verify no conflicting pre-existing processes listen on these ports).
make setup

# Install
# The Rust toolchain includes cargo can be installed [here](https://www.rust-lang.org/tools/install).
cargo install transmit

# Copy the configuration file.
cp sample.ron config.ron # Adjust to access nats and postgres dependencies.

# Run the program.
transmit config.ron

Docker-compose

To run the entire program and its dependencies in docker-compose, refer to the tests directory for a correct and continuously tested example configuration.

Kubernetes

The primary deployment environment for which this program is designed, is to run as a microservice in a Kubernetes cluster.

Helm

To deploy with helm, run the following.

# Add the helm repository.
helm repo add transmit https://kasbuunk.github.io/transmit

# Install the release. N.B.: make sure the required dependencies (Nats and Postgres)
# are deployed and accepting connections on the configured ports, with the configurable
# Postgres connection credentials.
helm install transmit transmit/transmit --values tests/values.yaml # Replace with your configuration.

Usage

Usage depends on the configured transport adapter and chosen Message variant.

Supported transport adapters:

Supported Message variants:

For example, if Nats is running in Kubernetes, run in separate terminals:

Prerequisites: kubectl and nats CLIs.

# Make nats accessible from the host.
kubectl port-forward svc/nats 4222:4222
# Observe and assert the expected events are published when scheduled.
nats sub -s "nats://localhost:4222" "MYSUBJECT.details"

Go client

Please refer to the client/go/client_test.go file for a simple, correct test how to interact with the Transmit program.

Other languages

The proto/transmit.proto file contains the necessary types and gRPC definitions in order to generate the protobuf and gRPC client code for most popular programming languages.

Design

The program applies careful separation of concerns. It is designed in the first place to be agnostic to its deployment environment.

The application has a set of loosely-coupled components. Each is defined by a trait in the contract module, such that components are properly unit-tested. The compose to a suitable set of adapters be implemented across an array of deployment environments.

Scheduler

The scheduler is the core in the program that defines the domain behaviour. It is responsible to determine what messages ought to be transmitted, when to do so and negotiates state retrieval and management of the scheduled transmissions with the repository.

Supported Schedule variants:

Repository

The repository is responsible for executing the state updates as commanded by the scheduler.

Supported adapters:

Transmitter

For each Message variant, a transmission adapter is implemented to broker transmission. The transmitter is responsible to send the messages and report if transmission was successful, such that the scheduler can remain agnostic of the implementation details.

Supported adapters:

Transport

The transport adapter is responsible for incoming message parsing and brokerage between outside invokers and the domain core, i.e. the Scheduler.

Supported transports:

Config

The config module provides an algebraic data structure that fully models the valid state of the system at startup. As such, the program will only start running if configured precisely with:

Contributing

Any feedback and help with development is greatly appreciated. Please feel free to open issues or pull requests for feature requests, bug reports, installation issues or any other questions you may have.

Roadmap

The roadmap lists many features, additional Message variants and targeted deployment environments, as well as other interesting features that make the state management of the Transmit program much more powerful. The roadmap is expected to change its contents and priorities. It is not ready to be shared publicly as of the current state of affairs.