Giter VIP home page Giter VIP logo

hermes's Introduction

Hermes

Hermes is a generic websocket notification service giving backend services the ability to submit real-time notifications to user facing web interfaces.

Use cases

  • Asynchronous jobs and status monitoring
  • Any kind of actions performed behind the scene that provide value to users (ex: "your request has been approved/denied", "your job has been picked up", etc)

Features

  • REST API to manage notifications (creation, aknowledgement, ...)
  • Websocket endpoint to get real-time notifications in web applications
  • Uses RabbitMQ to ensure scalablility
  • Notifications can either be transient or permanent (and then stored in database for future usage)
  • Permanent notifications can be "aknowledged" per user

Data model

  • Application: regroups a collection of channels
  • Channel: represents a topic of interest
  • Notification: events that can be pushed to channels
  • Notification tag: key-value tags that can be added to notifications
  • Notification client receipt: user aknowledgement of specific notifications

How it works

Hermes flow

Consumer

Users register to the Hermes WS endpoint with the following message:

register 
{
	"ApplicationName": "myapp", 
	"ClientId": "b239d7df-bfeb-4310-a840-43846a87efac", 
	"Channels": ["channel1", "channel2"], 
	"FetchLast": 10, 
	"LastNotificationId": 42
}

Users will then receive (at most) the last 10 "unacknowledged" notifications from the mentioned channels after the last received notification (if specified). The "LastNotificationId" field is meant to handle websocket reconnections without reloading a page.

Once registered, users will now receive all newly created notifications from the corresponding channels. Notifications will be received as json objects:

{
	"Type": "NewNotification",
	"Data": {
		"Id": 1,
		"Persistent": true,
		"ChannelId": 1,
		"ChannelName": "channel1",
		"ApplicationId": 1,
		"ApplicationName": "myapp",
		"Time": "2017-04-23T20:44:28.533",
		"Code": "new_notification",
		"Message": "Test new message in channel 1",
		"Tags": {
			"test_key_1": "test_value_1",
			"test_key_2": "test_value_2"
		}
	}
}

Producer

Backend applications can create notifications by calling Hermes API:

{
  "applicationName": "myapp",
  "channelName": "channel1",
  "code": "job_create",
  "message": "New job created",
  "persistent": true,
  "tags": {
    "test_key_1": "test_value_1",
    "test_key_2": "test_value_2"
  }
}

Dependencies

Hermes requires two things:

  • SQL database
  • RabbitMQ server

NuGet Dependencies

hermes's People

Contributors

mithra avatar josselin-muller-mpf avatar

Watchers

James Cloos avatar  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.