Stream Combiner is an application that allows you to create a combined stream. This stream combines / merges entries from all (original) individual streams.
- Application should be configurable to read data from N hosts:ports.
- Input streams provide data in XML format.
- Data in input stream could be veeery LARGE.
- Data in input stream is sorted by timestamp.
- Application output is JSON stream.
- Output data should be sorted by timestamp.
- If several inputs provide data with the same timestamp - amounts should be merged.
- Amounts could be positive/negative. And it's very sensitive data - like money. And nobody likes losing money.
- For extra bonus points:
- add solution in case if some input streams hang.
- imagine that timestamps comparing operation is VERY expensive - try to minimize it's usage.
- Project lifecycyle:
- You must use Maven 3.x to build the project.
- You must use JUnit to write tests for the project. Use of any JUnit extensions is allowed.
- Definition of XML format:
<data> <timestamp>123456789</timeStamp> <amount>1234.567890</amount> </data>
- XMLs in stream are separated by new line (
\n
) - Definition of JSON format:
{ "data": { "timestamp":123456789, "amount":"1234.567890" }}