A super lightweight shared nothing service for performing expiry callbacks against a Couchbase bucket where TTL (time to live) are set. The service provides a list of meta id's and expiry times for keys that will expire within a specified interval. It runs a simple instance of node.js and is configured exclusively through a REST API. It can be called dynamically as needed from an application, or configured to loop indefinitely and send the list of keys at a specified interval.
- [1] Install Node.js
- [2] Clone this repository
- [3] From the expiry-notifier directory, run "npm install"
- [4] Run, "npm start"
--Retrieves System Status.
--Sets the reference to the Couchbase server and bucket.
--Sets the endpoint url to send the list of expiring keys to as http://hostname:port/path. If "https" is passed, notifications will be sent over https. Note: omit any LEADING "/" characters in the :path. For example to send notifications to https://foo.com/bar call /setup/endpoint/foo.com/443/bar/https
--Sets the time window (:interval) in seconds to check for expiring keys. If :loop is set to "loop", the service will check run indefinitely, checking for expiring keys at the specified :interval. Looping requires endpoint above be defined.
--clears existing looping functionality.
--Sets the timing format returned with each meta id for keys that have expiry within the current polling interval. Default is UNIX epoch time, the number of seconds from 1/1/1970 when the key will expire. If relative is set to "true" it will return the number of seconds until the key expires from now.
/poll/:interval [RETURNS: {JSON OBJECT} with meta.id, meta.expiry (or if relative set to "true": seconds until expiry)]
--Request for applications to dynamically call the service (instead of a looped instance) to return meta id's and expiry times for keys set to expire within the time window (:interval).
--Creates a session with an id, information, and a ttl for testing.