lkt-processor

0.0.2 • Public • Published

lkt-processor

A message process framework based on AMQP service component (e.g RabbitMQ)

Installation

npm install lkt-processor

Message

Message should be include processor and data properties, data will be transfer to processor function

processor is required, data is empty allowed

{"processor": "example", "data": [1, 2, 3, 4]}

Processor

processor/example.js

exports.listeners = {

    'before': function(event) {

    },

    'after': function(event) {

    },

    'succeed': function(event) {

    },

    'failed': function(event) {

    }
}

exports.example = function(proc) {

    console.log('Example message processor');
    console.log(proc.getData());

    return true;
}

Output:

[2013-10-29 21:24:15.710] [INFO] console - Example message processor
[2013-10-29 21:24:15.711] [INFO] console - [ 1, 2, 3, 4, 5 ]

Versions

Current Tags

  • Version
    Downloads (Last 7 Days)
    • Tag
  • 0.0.2
    3
    • latest

Version History

  • Version
    Downloads (Last 7 Days)
    • Published
  • 0.0.2
    3
  • 0.0.1
    1

Package Sidebar

Install

npm i lkt-processor

Weekly Downloads

4

Version

0.0.2

License

none

Last publish

Collaborators

  • abbish