Implemented a Non Blocking Producer/Consumer stream processing service. the app is provided with a blackbox executable that spits out an infinite stream of lines of event data encoded in JSON. It consumes the output of the generator, gathers some stats and exposes these stats in an HTTP interface
-
Windows
-
Java 11
-
maven (+JAVA_HOME set to jdk)
GET localhost:8080/stat
RESPONSE:
{
"wordsCount": {
"lorem": 82,
"dolor": 70,
"amet": 53,
"ipsum": 68,
"sit": 71
},
"eventsCount": {
"bar": 127,
"foo": 112,
"baz": 105
}
}
GET localhost:8080/recent
RESPONSE:
{
"recentEventsCount": {
"bar": 14,
"foo": 16,
"baz": 13
},
"recentWordsCount": {
"lorem": 11,
"dolor": 11,
"amet": 6,
"ipsum": 3,
"sit": 12
}
}
-
Clone the repository:
$ git clone https://github.com/Itayventura/StreamProcessor.git
-
Build and run tests:
-
from git bash:
$ cd StreamProcessor/ $ mvn clean install
-
All modules should be built successfully
-
-
Run app (from terminal):
mvn compile exec:java -Dexec.mainClass="app.App"