JDK 8 or above SBT 0.13.17
- no persistence of request & results of comparison - during life of service results of comparison will be kept in memory and disappear after restart
- In case multiple data entries will be submited with the same IDs - data will be overwritten and during comparison we will rely on latest entries corresponding to queryId
- settings of parallelism will be defined by cfg file via deployment section for particular actors
- API endpoints will receive & return data in plain json format
- no auth & security
- ID of query will be treated as String - i.e. UUID or Integer based ids will be accepted
sbt assembly
will create fat jar with all dependencies at target/scala-2.11/json_diff-assembly-1.0.0.jar
- edit cfg file at conf/app.conf to change binded ip & port
- execute start.sh by invoking sh start.sh
- use following endpoints to validate requests:
# To verify that it is up & running
curl -w "\n" -XGET 'http://localhost:8080/healthcheck'
# To submit some data:
curl -v --request POST --data-binary "@data_samples/lena.png" http://localhost:8080/v1/diff/id123/left
curl -v --request POST --data-binary "@data_samples/glider.png" http://localhost:8080/v1/diff/id123/right
# To check result:
curl -w "\n" -XGET http://localhost:8080/v1/diff/id123
NOTE: in case you have encrypted home folder or mounted volume(s) you may need to run following commands before assembling and after every
sbt clean:
rm -rf ./target
mkdir /tmp/`echo $$`
ln -s /tmp/`echo $$` ./target