This project includes the resources needed to develop the Data and Metadata Adapters for the Lightstreamer DynamoDB Demo pluggable into Lightstreamer Server
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.
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 tablesDynamoData.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 informationDemoDataProvider.kt
implements the Data Adapter publishing the current time of the simulationDemoMetadataProvider.kt
implements a very basic Metadata Adapter for the demo
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.
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
.
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
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.
- Our blog post: Virtual Airport Demo: Connecting DynamoDB to Lightstreamer
- Compatible with Lightstreamer SDK for Java In-Process Adapters since 7.3.