- A machine with a working Docker installation
- JDK 17 + an IDE for working with Java projects
- Gradle >= 7.6 (or you can use the gradle-wrapper (
./gradlew) from the repository) - A PostgreSQL client
To verify that the environment works, run:
gradle clean test --tests EnvironmentSetupTest --info- Python producer of quotes and trades /producer
- Quotes are sent to the
tickstopic - Trades are sent to the
tradestopic - Used in integration tests
- The candidate does not need to dig into it
- Quotes are sent to the
- Java project /src
- Unit and integration tests /src/test
- EnvironmentSetupTest is an integration test that checks Kafka, the Python producers, and the Java code can work together.
- models POJO classes for JSON deserialization
- Unit and integration tests /src/test
You can prepare for the live coding session in advance and do it as "homework":
- Complete the following classes
com.exness.livecoding.models.Tick,com.exness.livecoding.models.Tradefor JSON deserialization, so that these tests pass:gradle test --tests com.exness.livecoding.models.TickTest gradle test --tests com.exness.livecoding.models.TradeTest
- JSON examples can be found in the tests, or seen in the logs when running the
EnvironmentSetupTesttest - The class must implement getters for all fields
- JSON examples can be found in the tests, or seen in the logs when running the
- Write a Kafka consumer that receives and deserializes JSON into the POJO objects implemented in step 1
Bring up Kafka, PostgreSQL and the Python producers:
docker-compose up -dServices exposed on the host:
- Kafka broker —
localhost:9092 - PostgreSQL —
localhost:5432, dblivecoding, userpostgres, passwordmysecretpassword
The application reads these settings from application.yml
(each value can be overridden via environment variables, e.g. KAFKA_BOOTSTRAP_SERVERS, SPRING_DATASOURCE_URL).
PostgreSQL is initialized with the schema from init.sql
(ticks, trades, trades_enriched tables).
Could not find a valid Docker environment when running the Testcontainers tests
(even though Docker is up). Recent Docker Desktop defaults to a newer Docker API
version that the bundled Testcontainers / docker-java client can fail to negotiate.
Fix: pin a minimum API version in Docker Desktop → Settings → Docker Engine, add
"min-api-version": "1.24" to the JSON config, then Apply & Restart:
{
"min-api-version": "1.24"
}