This project provides RTB exchange implemented for training purposes.
RTB exchange is based on OpenRTB API Specification 2.3 for bidding but has its own API.
A basic RTB exchange functionality was implemented.
Supported formats: JSON.
A list of features that are not supported in the current version:
- Multiple currencies support. RTB Exchange consider any currency as USD.
- Private Marketplace. Even though deal ids are being sent in the request, they will not be considered for any bidding strategy.
- Segments.
- Data providers.
- Macro encoding.
- Avro and Protobuf formats.
- Statistics (e.g. requests, impressions).
Building requires setting up database for tests or setting test in assembly := {}
for disabling tests.
The command sbt assembly
builds target/scala-2.11/rtb-exchange-<VERSION>-jar-with-dependencies.jar.
This project provides two options for docker images:
using Nexus
docker build -t <image name> -f Nexus.dockerfile --build-arg URL=<nexus URL> --build-arg USERNAME=<nexus user> --build-arg PASSWORD=<nexus user password> .
using a ready jar
docker build -t <image name> --build-arg APP_PATH=<path to jar with dependencies> .
To start database for tests use command
make db_up
To shutdown this database use command
make db_down
Before running application you should set up working database.
java -Dconfig.resource=application.<env>.conf -jar <PATH-TO-JAR>
- application.<env>.conf — file with configuration for environment <env>. Default value is application.prod.conf is already contained in jar file.
docker run -d -p<port>:8081 [-v <log_path>:/opt/rtb-exchange/logs] [--env env=<env>] <image_name>
- <env> — application environment (default prod). Current directory should contain application.<env>.conf file if this parameter has been set.
- <port> — listen port. Default value is 8081.
- <log_path> — directory for log files. Default value is ./logs.
- <image_name> — name of docker image.