Skip to content

Commit

Permalink
Now emitting data
Browse files Browse the repository at this point in the history
  • Loading branch information
zubairov committed Dec 16, 2016
1 parent 1e50e4a commit 5a85209
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions lib/triggers/consume.js
Original file line number Diff line number Diff line change
Expand Up @@ -17,9 +17,10 @@ function processAction(msg, cfg) {
const amqpURI = cfg.amqpURI;
const amqpExchange = cfg.topic;
const queueName = `eio_consumer_${process.env.ELASTICIO_TASK_ID}_${process.env.ELASTICIO_USER_ID}`;
const keys = (cfg.bindingKeys || '#').split(',').map((s)=>s.trim());
const keys = (cfg.bindingKeys || '#').split(',').map((s) => s.trim());
const consumer = (msg) => {
console.log('consuming message %s in generator', JSON.stringify(msg.content.toString()));
console.log('Have got message %s', JSON.stringify(msg.content.toString()));
this.emit('data', eioUtils.newMessageWithBody({}));
};
co(function*() {
console.log('Connecting to amqpURI=%s', amqpURI);
Expand All @@ -38,7 +39,7 @@ function processAction(msg, cfg) {
autoDelete: true
});

for(let key of keys) {
for (let key of keys) {
console.log(`Binding queue to exchange queue=${queueName} exchange=${amqpExchange} bindingKey=${key}`);
yield channel.bindQueue(queueName, amqpExchange, key);
}
Expand Down

0 comments on commit 5a85209

Please sign in to comment.