Messaging Service <img src=“https://travis-ci.org/dwaynemac/padma-messaging.png” /> <img src=“https://codeclimate.com/github/dwaynemac/padma-messaging.png” /> <img src=“https://gemnasium.com/dwaynemac/padma-messaging.png” alt=“Dependecies” /> <img src=“https://coveralls.io/repos/dwaynemac/padma-messaging/badge.png” alt=“Coverage Status” />¶ ↑
Web Service for apps to send asyncronic messages
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
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.
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')
Run
bundle exec yardoc --plugin rest
then open doc/index.html
Rails (rails-api)
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.