./gradlew bootRun
In another terminal:
curl -X POST http://localhost:8080/trades -H "Content-Type: application/json" -d '{"filenames":["event0.xml", "event1.xml", "event2.xml"]}'
curl -X GET http://localhost:8080/trades | jq
or if jq
is not installed:
curl -X GET http://localhost:8080/trades
filter
can be easily extended by adding queries with Specifications- H2 is used for DB layer, it is in memory DB so when the service stop all data will be lost. It can be replaced by any other Databases.
- The service is reading XML files from
eventXmlFilesPath
which defined inapplication.properties
- The service is using blocking calls, would be better to use Reactive or CompletableFuture to get data from Repository asynchronously.
- Use multi-thread to parse XML files in parallel.
- Add tests for XmlParser, e.g. malformed XMLs.
- Use ANTLR to make the filter to support SQL-like queries from the endpoint.