Skip to content

Commit 5a85209

Browse files
committed
Now emitting data
1 parent 1e50e4a commit 5a85209

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

lib/triggers/consume.js

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -17,9 +17,10 @@ function processAction(msg, cfg) {
1717
const amqpURI = cfg.amqpURI;
1818
const amqpExchange = cfg.topic;
1919
const queueName = `eio_consumer_${process.env.ELASTICIO_TASK_ID}_${process.env.ELASTICIO_USER_ID}`;
20-
const keys = (cfg.bindingKeys || '#').split(',').map((s)=>s.trim());
20+
const keys = (cfg.bindingKeys || '#').split(',').map((s) => s.trim());
2121
const consumer = (msg) => {
22-
console.log('consuming message %s in generator', JSON.stringify(msg.content.toString()));
22+
console.log('Have got message %s', JSON.stringify(msg.content.toString()));
23+
this.emit('data', eioUtils.newMessageWithBody({}));
2324
};
2425
co(function*() {
2526
console.log('Connecting to amqpURI=%s', amqpURI);
@@ -38,7 +39,7 @@ function processAction(msg, cfg) {
3839
autoDelete: true
3940
});
4041

41-
for(let key of keys) {
42+
for (let key of keys) {
4243
console.log(`Binding queue to exchange queue=${queueName} exchange=${amqpExchange} bindingKey=${key}`);
4344
yield channel.bindQueue(queueName, amqpExchange, key);
4445
}

0 commit comments

Comments
 (0)