las2peer-ActivityTracker is a microservice to provide activity information for las2peer services. The service works together with all kinds of microservices.
The activity tracker response to HTTP or (las2peer) p2p requests and can fetch activity objects from the origin microservice which created an activity. This service has also build-in MQTT support, so that all new activities will get publish to an MQTT broker of your choice. To enable MQTT publish please provide the MQTT information in the configuration file.
We also provide a modern webcomponent frontend for this service which you can find also on Github.
The service is under development. You can participate by creating pull requests or by discussing ideas and requirements inside Requirements-Bazaar.
More information about our microservice ecosystem is explained in our Requirements-Bazaar wiki on Github.
We use Swagger for documenting this microservice. You can use Swagger UI to inspect the API. You can inspect the API documentation of our live (master branch) instance an our beta (develo branch) with our Swagger UI instance.
API documentation endpoint:
The activity tracker is built on Java technologies. As a service framework we use our in-house developed las2peer project. For persisting our data we use MySQL database and jOOQ to access it. User input validation is done using Jodd Vtor library and for serializing our data into JSON format, we use the Jackson library. As MQTT client we use Eclipse Paho.
In order to be able to run this service project the following components should be installed on your system:
- JDK (min v1.8) + Java Cryptography Extension (JCE)
- MySQL 5.7
- Apache Ant to build
How to set up the database
git clonethis repo
- To configure your database access look at the Configuration section
- Compile the project with
- Create a new database called
reqbaztrack, possibly with UTF-8 collation
ant migrate-dbto create your db schema or migrate to a newer version while updating your service
- If you need sample data run the file
You need to configure the the service to your own specific environment. Here is the list of configuration variables:
dbUserName: Database username, which will be used to access the database
dbPassword: Database user password, which will be used to access the database
dbUrl: JDBC Connection string to access the database
land: Default language setting
country: Default country setting
baseURL: Base URL this service runs on
mqttBroker: MQTT Broker, if this field is set it enables MQTT publish of new activities
mqttUserName: MQTT username to publish to broker, if this field is set MQTT use username and password. If not it MQTT doe not use authorize to broker.
mqttPassword: MQTT password to publish to broker
mqttOrganization: Your organisation name, used as first channel description in MQTT
For other configuration settings, check the las2peer project.
For build management we use Ant. To build the cloned code, please using a console/terminal navigate to the
home directory, where the
build.xml file is located and run the following command:
You can also generate a bundled jar with all the dependencies with the command
How to run
- First please make sure you have already set up the database
- Make sure your config settings are properly set.
- Open a console/terminal window and navigate to the
- Run the
How to run using Docker
Docker will be provided at a later point.
Troubleshooting & FAQ
- I get Java encryption errors: Did you install Java Cryptography Extension?
- I can not run the start script: Check if you have OS permission to run the file.
- The service does not start: Check if all jars in the lib and service folder are readable.
- The start script seems broken: Check if the start script has the correct encoding. If you ran the service on Unix use
dos2unixto change the encoding.
- To enable MQTT publish of new activities set
mqttOrganizationin property file.