Skip to content
基于AMQP消息队列服务的消息处理框架
JavaScript
Find file
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Failed to load latest commit information.
dist
src
.gitignore
Gruntfile.js
LICENSE
README.md
package.json

README.md

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 ]
Something went wrong with that request. Please try again.