Skip to content

tkurylek/reactor

Repository files navigation

Table of Contents

Reactor

Reactor is a lightweight, system resource friendly, system integration and data retrieval micro kernel intended to be stupid simple making development process easy and painless. It was forged to make those possible:

  • connect to any system you can imagine (just name it),
  • get some interaction running,
  • have results presented in the same manner no matter what system it was.

First version of Reactor (then called just ... IRCBot) have been limited only to IRC platform and was doing some vary basic logic back then.

Architecture overview

Reactor architecture

Reactor system have been divided into two layers whereas each of them manages entities of two different kinds:

  • TransportController - loads and stores list of objects (ReactorMessageTransport) providing access to system API through so called "Message Transports", whereas each object wraps and handles calls going through a given communication channel/protocol. It can be literally any communication channel existing out there:
    • IRC,
    • Telnet,
    • HTTP by REST or WebSockets,
    • Skype,
    • Microphone input together with voice recognition and synthesis,
    • Many many others ...
  • ReactorController - loads and stores list of objects (Reactor)) where each of them stands for a single unit of logic that is usually glued together with some external system like:
    • JIRA,
    • Jenkins,
    • Sonar,
    • etc.

Each entity type, be it ReactorMessageTransport or Reactor, is being loaded from application classpath using JDK ServiceLoader factory object and glued together in system initialization phase.

System usage concept

IN PROGRESS

Transport - Reactor interaction

Because of generic nature of the system, there is only one interaction process suitable for any message transport or reactor that takes a part in a communication act.

Having a given interaction diagram the process can be explained as following:

  1. Request comes in through a ReactorMessageTransport instance,
  2. Request object specific to given transport type is converted into ReactorRequestInput instance,
  3. ReactorRequestInput is then sent into configured ReactorRequestHandler instance for further processing,
  4. System asks ReactorController for a Reactor instance that can accept ReactorRequestInput by matching their argument values,
  5. Then ReactorRequestInput is sent into Reactor instance for processing where ReactorResponse is produced as an outcome,
  6. Provided ReactorResponse instance is going through a rendering process with one of available ReactorResponseRenderer implementations and goes back to a ReactorMessageTransport instance.

Transport interaction with Reactor

Project structure

Project folder structure consist of several maven project modules located in following folders:

IN PROGRESS

Building up and running

Whole build process is quite straightforward and required only maven to be available in system binaries path, then just navigate to downloaded source code folder and run:

mvn clean install

It will then compile just base system modules like reactor-api, reactor-bootstrap and so on. When you would like to build system with all extensions provided just use a dedicated switch for maven:

mvn clean install -DprovidedModules=true

This process will do the same as above but also will go through every extension that is located under reactor-lib module, compile it and build a JAR archive with all required dependencies included.

When you want to start up the system there are basically two options available:

  • run script run-cmd that will pass command line parameters as an reactor input and print out results into terminal output,
  • run script run-reactor which results in starting up all transports and reactors available in system classpath.

Those two scripts are located under reactor-bootstrap/target/dist/bin folder in two operating system flavors (windows and linux).

Distribution folder structure

Structure of distribution package folder (that is **reactor-bootstrap/target/dist), is quite straightforward and it's naming follows common used conventions. Basically we can enlist three folders out there:

  • /bin - consists of scripts for starting up the system, there should be couple of them each for a single dedicated operating system,
  • /etc - one can find all configuration files used by a system and system extensions as well,
  • /lib - contains basic libraries used by system mechanisms,
  • /ext - put your system extensions here, both Reactor and ReactorMessageTransport implementations.

Installing system extensions

After building system source code with provided modules you can find the outcome of the process as a set of JAR files with all dependencies required by each of modules being built. Each of jar file is locater under corresponding module subfolder in reactor-lib/[module-folder]/target. Please note that JAR file generated for one module comes in two flavors. Get the one with -jar-with-dependencies suffix in file name, copy it over into /ext subfolder of distribution package and you're done :) Now start up the system and enjoy new extension.

Creating own extensions

IN PROGRESS, follow source code of provided modules for now

System configuration

There are two configuration files provided for all message transports and reactors installed in the system located under reactor-bootstrap/target/dist/etc folder:

  • reactor.properties - consists of setting entries for all reactors out there, where each entry has a dedicated prefix recognized by a given reactor implementation, eg: all entries starting with string reactor.sonar will be passed over to Sonar Reactor in system initialization phase,
  • transport.properties -

IN PROGRESS

Build Status

About

Reactor micro integration framework

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Contributors 2

  •  
  •