Commit ad4956e1 by Chavee Issariyapat

reuse seneca instance

parent b68560ee
...@@ -6,22 +6,35 @@ var LRU = require("lru-cache") , ...@@ -6,22 +6,35 @@ var LRU = require("lru-cache") ,
maxAge: 1000 * 60 * 5 maxAge: 1000 * 60 * 5
}); });
var client_wf = require('seneca')() var senecaAMQP = require('seneca')().use('seneca-amqp-transport');
.use('seneca-amqp-transport') var client_wf = senecaAMQP.client({
.client({
type: 'amqp', type: 'amqp',
pin: 'cmd:wf', pin: 'cmd:wf',
url: 'amqp://'+config.get('rabbitmq_username')+':'+config.get('rabbitmq_password')+'@'+config.get('rabbitmq_host')+':'+config.get('rabbitmq_port') url: 'amqp://'+config.get('rabbitmq_username')+':'+config.get('rabbitmq_password')+'@'+config.get('rabbitmq_host')+':'+config.get('rabbitmq_port')
}); });
var client_push = senecaAMQP.client({
var client_push = require('seneca')()
.use('seneca-amqp-transport')
.client({
type: 'amqp', type: 'amqp',
pin: 'cmd:push', pin: 'cmd:push',
url: 'amqp://'+config.get('rabbitmq_username')+':'+config.get('rabbitmq_password')+'@'+config.get('rabbitmq_host')+':'+config.get('rabbitmq_port') url: 'amqp://'+config.get('rabbitmq_username')+':'+config.get('rabbitmq_password')+'@'+config.get('rabbitmq_host')+':'+config.get('rabbitmq_port')
}); });
// var client_wf = require('seneca')()
// .use('seneca-amqp-transport')
// .client({
// type: 'amqp',
// pin: 'cmd:wf',
// url: 'amqp://'+config.get('rabbitmq_username')+':'+config.get('rabbitmq_password')+'@'+config.get('rabbitmq_host')+':'+config.get('rabbitmq_port')
// });
// var client_push = require('seneca')()
// .use('seneca-amqp-transport')
// .client({
// type: 'amqp',
// pin: 'cmd:push',
// url: 'amqp://'+config.get('rabbitmq_username')+':'+config.get('rabbitmq_password')+'@'+config.get('rabbitmq_host')+':'+config.get('rabbitmq_port')
// });
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment