Skip to content

Itayventura/StreamProcessor

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

10 Commits
 
 
 
 
 
 

Repository files navigation

StreamProcessor

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

Prerequisites

  • Windows

  • Java 11

  • maven (+JAVA_HOME set to jdk)

Rest APIs

get events count and words count request

GET localhost:8080/stat

RESPONSE:

{
  "wordsCount": {
    "lorem": 82,
    "dolor": 70,
    "amet": 53,
    "ipsum": 68,
    "sit": 71
  },
  "eventsCount": {
    "bar": 127,
    "foo": 112,
    "baz": 105
  }
}
get events count and words count of last 60 seconds request

GET localhost:8080/recent

RESPONSE:

{
  "recentEventsCount": {
    "bar": 14,
    "foo": 16,
    "baz": 13
  },
  "recentWordsCount": {
    "lorem": 11,
    "dolor": 11,
    "amet": 6,
    "ipsum": 3,
    "sit": 12
  }
}

Installation

  1. Clone the repository:

    $ git clone https://github.com/Itayventura/StreamProcessor.git
  2. Build and run tests:

    • from git bash:

      $ cd StreamProcessor/
      $ mvn clean install
    • All modules should be built successfully

  3. Run app (from terminal):

    mvn compile exec:java -Dexec.mainClass="app.App"

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages