GithubHelp home page GithubHelp logo

message-processing-system's Introduction

Message Processing System

Overview

This repository contains a demo of a basic message processing system. The system includes the following components:

  • Ingest Service - Ingestion of new messages into the system
  • Processing Service - Processing of each message ingested into the system
  • Monitoring Service - Tracking of ingested messages status
  • RabbitMq - Messaging queue between services
  • Redis - Cache for messages status tracking

Installation

The demo and third parties were installed and tested on a Windows machine. Third parties configurations were set to defaults (such as: listening port, localhostas host, etc).

These are the steps needed in order to run all the components in the system.

RabbitMQ

Redis

Redis Desktop Manager

  • (Optional) You can also download and install RedisDesktopManager to visualize the contentn of redis from:

Services

  • Go to directoy "/binaries" in this repo and you'll find all services jars
  • Start each service by running its jar (Use different CMD windows, one for each service )
    • java -jar ingest-service-0.0.1-SNAPSHOT-spring-boot.jar
    • java -jar processing-service-0.0.1-SNAPSHOT-spring-boot.jar
    • java -jar monitoring-service-0.0.1-SNAPSHOT-spring-boot.jar

That's it!

Rest APIs

There are two Rest API:

  • Message Status API
  • Ingest Message API

Message Status API

There's one API for checking the status of a specific messages (Statuses are kept for 20 min)

Request

GET /message-statuses/{messageId}
Host: localhost:9003
Content-Type: application/json

Response (200 OK)

{
  "messageId": {messageId},
  "status": {messageStatus}
}

Response (400 BadRequest, 404 NotFound, 500 InternalServerError)

{
  "details": "description of problem/error"
}

Examples

EXAMPLE1 - (MessageId was found and status is returned)
Request:
    GET /message-statuses/74ffbca8-c543-4e53-a389-4643cbd2807d HTTP/1.1
    Host: localhost:9003
    Content-Type: application/json
Response:
    200 OK
    {
      "messageId": "74ffbca8-c543-4e53-a389-4643cbd2807d",
      "status": "COMPLETED"
    }


EXAMPLE2 - (messageId doesn't exist)
Request:
    GET /message-statuses/05c2b18f-d240-49ca-8c10-b7d8ba1b381f HTTP/1.1
    Host: localhost:9003
    Content-Type: application/json
Response:
    404 Not Found
    {
      "details": "Status was not found for messageId:05c2b18f-d240-49ca-8c10-b7d8ba1b381f"
    }

Ingest Message API

Request

POST /ingest-messages HTTP/1.1
Host: localhost:9001
Content-Type: application/json
Body:
    {
      "body": {messagePayload}
    }

Response (200 OK)

{
  "messageId": "{generatedMessageId}"
}

Response (400 BadRequest, 500 InternalServerError)

{
  "details": "description of problem/error"
}

Examples

EXAMPLE1 - (happy flow)
Request:
    POST /ingest-messages HTTP/1.1
    Host: localhost:9001
    Content-Type: application/json
    Body:
      {
        "body": "message payload here"
      }
Response:
    200 OK
    {
      "messageId": "8ab93084-8dc5-4eb6-99d8-e379595a95a7"
    }


EXAMPLE2 - (Invalid message payload)
Request:
    POST /ingest-messages HTTP/1.1
    Host: localhost:9001
    Content-Type: application/json
    Body:
      {
        "body": ""
      }
Response:
    400 Bad Request
    {
      "details": "Invalid ingest message payload"
    }

message-processing-system's People

Contributors

heinrichcohn avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.