senecajs / seneca-redis-queue-transport

Seneca micro-services message transport with Redis queues
MIT License
9 stars 15 forks source link

Cannot listen for multiple methods #29

Open acehko opened 7 years ago

acehko commented 7 years ago

I am having problems listening for multiple methods in one service. My code:

const Seneca = require('seneca');

const seneca = Seneca();
seneca.use('redis-queue-transport');

seneca.add({ role : 'r', cmd : 'a' }, (msg, reply) => {
    reply(null, { ok : true });
});

seneca.add({ role : 'r', cmd : 'b' }, (msg, reply) => {
    reply(null, { ok : true });
});

seneca.listen({ type : 'redis-queue', pin : 'role:r' });

Redis log:

1485164021.674526 [0 172.17.0.1:56026] "info"
1485164021.674815 [0 172.17.0.1:56028] "info"
1485164021.676595 [0 172.17.0.1:56026] "brpop" "seneca_cmd_a_role_r__act" "0"

It seems that the transport will only listen for one method. Am I doing something wrong?