Giter Site home page Giter Site logo

data-broker's Introduction

Data Broker

License badge Docker badge Build Status codecov

This repository contains the implementation for the event broker used internally by dojot's event processing services.

What it does

Data Broker provides two services: Kafka's topic management and real-time data. These are required by most of the services that compose dojot, being essential to maintain the system working.

The topic management service handles Kafka's topics, used for information dissemination (e.g. device creation events), handling the creation of runtime Kafka topics that segregate information on a tenant context basis, restricting the set of events a given service is exposed to only the ones it is actually allowed to process.

The real-time service deals with the routing of data received via sockets that is directed to one or more devices. This data is shown in the device information screen in the GUI.

As we are dealing with Kafka queues, it is up to the consumers of the returned topics to keep track of where the head of its processed queue is at. That allows consumers to process events at their own pace, thus avoiding unwanted data loss in the process. Another important characteristic of the configured topics is that, by default, they are single-partitioned without replications. This can be changed by using endpoints. Check Data Broker's API reference for more information.

dojot dependencies

Data Broker depends on some dojot modules to run. The minimum set of modules it needs to run is:

  • Auth
  • Kafka
  • Redis

Configuration

These are the environment variables used by Data Broker code.

Key Purpose Default Value
DATABROKER_CACHE_HOST Redis cache host address "data-broker-redis"
DATABROKER_KAFKA_ADDRESS Kafka address "kafka"
DATABROKER_KAFKA_PORT Kafka port 9092
HC_CPU_USAGE_TIMEOUT Healthcheck CPU usage timeout (ms) 300000
HC_KAFKA_TIMEOUT Healthcheck Kafka timeout (ms) 30000
HC_MEMORY_USAGE_TIMEOUT Healthcheck Memory usage timeout (ms) 300000
HC_UPTIME_TIMEOUT Healthcheck Uptime timeout (ms) 300000
KAFKA_NUM_PARTITIONS Default number of partitions in Kafka topics 1
KAFKA_REPLICATION_FACTOR Default replication factor in Kafka topics 1
LOG_LEVEL Logger level (error, warn, info, debug) "info"
SERVICE_PORT Data Broker service port 80

Some environment variables are used by dojot libraries that Data Broker uses.

Key Purpose Default Value
AUTH_URL Auth host address "http://auth:5000"
DATA_BROKER_URL Data Broker host address "http://data-broker"
DEVICE_MANAGER_URL Device Manager host address "http://device-manager:5000"
DOJOT_MANAGEMENT_TENANT Management tenant "dojot-management"
DOJOT_MANAGEMENT_USER Management user "dojot-management"
DOJOT_SUBJECT_DEVICES Subject for device management messages "dojot.device-manager.device"
DOJOT_SUBJECT_DEVICE_DATA Subject for device data messages "device-data"
DOJOT_SUBSCRIPTION_HOLDOFF Time (ms) before attempting to subscribe to a set of topics 2500
DOJOT_SUBJECT_TENANCY Subject for tenancy messages "dojot.tenancy"
KAFKA_GROUP_ID Kafka group ID for consumers "kafka"
KAFKA_HOSTS List of Kafka instances "kafka:9092"

How to run

Beforehand, you need an already running dojot instance in your machine. See dojot documentation for more information on installation methods.

Generate a Docker image:

docker build -t <username>/data-broker:<tag> -f docker/Dockerfile .

Then an image tagged as <username>/data-broker:<tag> will be made available. You can send it to your DockerHub registry to made it available for non-local dojot installations:

docker push <username>/data-broker:<tag>

NOTE THAT an official image is provided at dojot's DockerHub.

Documentation

Removal Notes

As of version v0.5.0, the subscription service is being removed from Data Broker because of its lack of use. As a consequence, the endpoint /subscription has being removed.

Issues and help

If you found a problem or need help, leave an issue in the main dojot repository and we will help you!

data-broker's People

Contributors

eduardogmisiuk avatar giovannicuriel avatar mmagr avatar andersonluisribeiro avatar code-factor avatar matheuscampanhaf avatar mprevide avatar rascaraficci avatar canattofilipe avatar thiagodpf avatar marianoleonardo avatar hvjunior avatar

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.