Building
========

This project supports sbt-assembly to package the server with all dependencies.
Just run "sbt assembly".


Running
=======

The packaged jar can be run with "java -jar sensebox-simple-rest-server-assembly-$version.jar"


Configuring
===========

SenseboxSimpleRESTServer takes a config file on HOCON format (see https://www.playframework.com/documentation/2.5.x/ConfigFile
for details). The config file must be specified by using the parameter "-Dconfig.file=$filename" (which must be put in
front of "-jar ...").

http.port
        The HTTP port SBSRS is listening. Default: "9100".

sbsrs.kafkaServer
        The Kafka server SBSRS connects to. You can provide multiple server as "server1:port1,server2:port2,...". Default: "localhost:9092"

sbsrs.kafkaTopic
        The Kafka topic to which SBSRS published sensor reading messages. Default: "sensebox-measurements"

sbsrs.kafkaMaxBlockMs
        Time in milliseconds how long Kafka will block when sending a record. See http://kafka.apache.org/documentation/#producerapi for details. Default: "5000"

play.crypto.secret
        Used by Play Framework to sign session cookies and for built-in encryption tools.
        As SBSRS does not use sessions or encryption, it is unneccessary, but Play requires it to be set to a value other than "changeme".
        For details see https://www.playframework.com/documentation/2.5.x/ApplicationSecret

Alternatively to putting the config into a file, you can specify the parameters on command line as java system properties.
E.g. "java -Dkafka.server=kafka01.fzi.de:9092,kafka02.fzi.de:9092 -Dplay.crypto.secret=42 -jar sensebox-simple-rest-server-assembly-$version.jar"