dwaynemac / padma-messaging

Messaging service

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Web Service for apps to send asyncronic messages

API

issuing a message

POST /v0/messages, {message: { key_name, data}, app_key}

see details in doc/index.html

registering for notifications

POST /v0/notify_me {notify_me: {key_name, url, secret_key}, app_key}

see details in doc/index.html

unregistering for notification

DELETE /v0/notify_me {key_name, app_key}

see details in doc/index.html

list key_names to wich i’m registered to notification

GET /v0/notify_me {app_key}

see details in doc/index.html

Notification

Messaging will send a POST request with the following body to all subscribed URLs.

{key_name, data, secret_key(if configured) }

it will expect a success status (=>200,<300) to consider message recieved or will retry.

Creating an app_key for an application

This has to be done in the console by a sys-admin

a = App.create(name: 'application-name', app_key: 'xxx-yy')
a.app_allowed_keys.create!(key_name: 'enrollment')

Generating API Documentation

Run

bundle exec yardoc --plugin rest

then open doc/index.html

Framework

Rails (rails-api)

Deployment

App has two main processes. web and worker (see Procfile). To start app locally just run:

bundle exec foreman start

On heroku we are currently using 2 instances one for the web-service and one for the worker.

About

Messaging service


Languages

Language:Ruby 86.0%Language:HTML 13.9%Language:Shell 0.0%