Skip to content

Scala and Akka based library to export incoming data to locations

License

Notifications You must be signed in to change notification settings

meandor/transporter

Repository files navigation

Transporter

Build Status GitHub license release

A Scala-Library that transports matter to locations using Akka and Prometheus metrics.

"Transporting really is the safest way to travel."

-- Geordi La Forge, 2369 ("Realm of Fear"), Star Trek

In other words it exports data to other locations. It can be used to export data to APIs.

Transporter Image

Testing

Execute the tests with gradle:

./bin/go check

Building

To build with gradle:

./bin/go clean build

This will create a jar file in ./build/libs without the dependencies.

Releasing and Publishing

./bin/go release

Will release a newer version with semantic versioning

./bin/go publish

will publish the artifact to maven central.

Outgoing Data

Register an Akka-Actor with the system for each location you want to transport to. For that just add new com.github.meandor.transporter.platform.Platforms.

Each Platform consists of a PhaseTransitionCoil and a TargetingScanner. The PhaseTransitionCoil is responsible for transforming matter to energy or in other words transform incoming data (e.g. entity) into data that can be exported (e.g. DTO).

The TargetingScanner is responsible to lock onto the target depending on the given location. In other words find the proper API abstraction to export to (adapter), which is called Target.

To add an Export you have to add a new Platform actor with an implementation of PhaseTransitionCoil and TargetingScanner which define how to export incoming data.

...
system.actorOf(Platform.props(SpecificPlatformPTC, SpecificPlatformTS), "SpecificPlatformName")
...

where SpecificPlatformTS and SpecificPlatformPTC tell the Platform how to beam Matter and system is an Akka Actor System.

object SpecificPlatformTS extends TargetingScanner {  
...
}

object SpecificPlatformPTC extends PhaseTransitionCoil {  
...
}

Example

https://github.com/meandor/voyage-transporter

Metrics

Prometheus metrics are registered and available.

Links