Giter Site home page Giter Site logo

pradeepvemulakonda / pushapi Goto Github PK

View Code? Open in Web Editor NEW
1.0 2.0 0.0 188 KB

A Basic Implementation of PUSH API's in JAVA using RabbitMq as middleware

License: Other

Java 100.00%
pushapi rabbitmq exchange java registry notifications observer-thread

pushapi's Introduction

PushApi

A sample project to enable push notifications for resource updates.

Tools

  • Java
  • Apache CXF
  • Jetty
  • Java 7
  • Apache derby
  • RabbitMQ

Design

The Push server is designed as a publish subscribe model implementataion. THe implemntation is backed by a persistent message queue and an exchange for routing.

Each resource that needs to be exposed a service will create a new Queue with the resource name as the queue name. The exchange in RabbitMq is set in direct mode and based on the resource updates the messages are routed to the specific queue.

The resource updates are pushed as a HTTP post.

The susbscription for notification requires a valid http endpoint with no security.

One thread listener will be created per resource exposed in the PUSH API.

High Level model:

Design high level

Registration Sequence

Register Sequence

Push Server Sequence

Push Server Sequence

Description
  • Client Registers with Registry server with a HTTP endpoint creating a subscriber for resource.
  • Once the Push Server is started then queues are created for each resource supported in the Resources enum.
  • There will be one observer thread on each queue waiting for messages.
  • Once a message is placed in the queue the observer thread gets the subscriber from the registry and passes on the message by triggering a POST message onto the subscriber endpoint.

Not Covered in the sample

  • Error handling

pushapi's People

Contributors

pradeepvemulakonda avatar

Stargazers

 avatar

Watchers

 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.