Giter VIP home page Giter VIP logo

simple-messaging's Introduction

Simple Messaging

Technologies:

  • Spring Boot 2 (Using spring-boot-starter-webflux, spring-boot-starter-websocket)

Dependencies:

  • Java 8 (required)

Install using default profile

mvn -U clean install

Run application

Run java application with specific version from project directory

mvn spring-boot:run

Run java application with specific version from jar

java -jar target/simple-messaging-<version>.jar

API Documentation

There are 3 API in this project, 2 REST API (also can be accessed from swagger - http://localhost:8899/swagger-ui.html) and 1 Websocket endpoint.

1. Submit Message API

Endpoint for submit message with method POST

/simple-messaging/v1/messages

This endpoint must include request in body for the message like

{ "message" : "your desire message"}

Expected response

{
  "code": "OK",
  "status": "OK",
  "data": {
    "message": "some message"
  },
  "error": null,
  "time": "2019-11-07T03:14:38.024+0000"
}

Message that have been submitted will send to subscription /topic/message to be consumed by websocket

2. Collect Message API

Endpoint for collect message that has been submitted, using method GET

/simple-messaging/v1/messages/collect

Expected response

{
  "code": "OK",
  "status": "OK",
  "data": [
    {
      "message": "some message"
    },
    {
      "message": "from another one"
    }
  ],
  "error": null,
  "time": "2019-11-07T04:09:03.938+0000"
}

You will received all message that have been submitted.

3. Message Data Websocket API

Connect websocket with this url

ws://{host}:{port}/message-ws

Example ws://localhost:8899/message-ws

Create subscription for

/topic/message

Message that will be received only message that submit after subscription created.

Expected response for this subscription

{
  "code": "OK",
  "status": "OK",
  "data": {
    "message": "some message"
  },
  "error": null,
  "time": "2019-11-07T04:09:03.938+0000"
}

simple-messaging's People

Contributors

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