Skip to content

deqing/trade-reporting-engine

Repository files navigation

Trade Reporting Engine

How to run

./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

Design

design.png

  • 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.

Note

  • The service is reading XML files from eventXmlFilesPath which defined in application.properties

Further Improvement

  • 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.

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages