Skip to content

This project includes the resources needed to develop the Data and Metadata Adapters for the Lightstreamer DynamoDB Demo pluggable into Lightstreamer Server

License

Notifications You must be signed in to change notification settings

Lightstreamer/Lightstreamer-example-DynamoDB-adapter-kotlin

Repository files navigation

Lightstreamer - DynamoDB Demo - Kotlin Adapter

This project includes the resources needed to develop the Data and Metadata Adapters for the Lightstreamer DynamoDB Demo pluggable into Lightstreamer Server

Infrastructure

The Demo simulates a basic departures board with a few rows, which represent information on flights departing from a hypothetical airport. The data are simulated with a random generator provided in this project and written in two Amazon DynamoDB tables.

As an example of a client using this adapter, you may refer to the Lightstreamer - DynamoDB Demo - Web Client and view the corresponding Live Demo.

Details

The source code of the projects is basically divided into two packages:

  • demo, which implements the operations with DynamoDB both as regards reading the updates to be injected into the Lightstreamer server but also the simulator of flight information. In particular, the following classes are defined:
    • DemoPublisher.kt, implementing the simulator generating and writing flight monitor data into two DynamoDB tables
    • DynamoData.kt, once subscribed by the clients, reading data from the DynamoDB tables and pushing as updates into the Lightstreamer server

  • server, that implements the Lightstreamer in-process adapters based on the Java In-Process Adapter API . in particular:
    • DemoDepartureProvider.kt implements the Data Adapter publishing the simulated flight information
    • DemoDataProvider.kt implements the Data Adapter publishing the current time of the simulation
    • DemoMetadataProvider.kt implements a very basic Metadata Adapter for the demo

Build and Install

To build and install your own version of these adapters you have two options: either use Gradle (or other build tools) to take care of dependencies and building (recommended) or gather the necessary jars yourself and build it manually. For the sake of simplicity, only the Gradle case is detailed here.

Gradle

You can easily build and run this application using Gradle through the build.gradle file located in the root folder of this project. As an alternative, you can use an alternative build tool (e.g. Gradle, Ivy, etc.).

Assuming Gradle is installed and available in your path you can build the demo by running

 $ gradle installDist 

If the task completes successfully it also created a build/install/DynamoDB folder, ready to be deployed under the LS_HOME/adapters.

AWS DynamoDB

Both the Data Adapters and the simulator use two DynamoDB tables that you have to create empty in an AWS region of your choice:

- DemoCurrentTimeData
- DemoDeparturesData

AWS CLI

Please note that you should also make sure that on the server running the adapters the AWS Command Line Interface version 2 is installed and properly configured with credentials allowing Read/Write access to the DynamoDB tables for the region you have used in the previous step.

See Also

Clients Using This Adapter

Related Projects

Lightstreamer Compatibility Notes

  • Compatible with Lightstreamer SDK for Java In-Process Adapters since 7.3.

About

This project includes the resources needed to develop the Data and Metadata Adapters for the Lightstreamer DynamoDB Demo pluggable into Lightstreamer Server

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Languages