senecajs / seneca-redis-pubsub-transport

Seneca micro-services message transport over Redis pubsub
MIT License
16 stars 20 forks source link

Misbehaviour when actions are pinned #34

Open dgonzalez opened 8 years ago

dgonzalez commented 8 years ago

This is related to (and aggregates):

When the actions are pinned for some reason even if the topic is specified the client is not able to reach the server.

dgonzalez commented 8 years ago

Code to reproduce:

Client:

'use strict'

let seneca = require('seneca')()
seneca.use('seneca-redis-transport').ready(function () {
  this.act({foo: 'one', bar: 'aloha'}, function (err, response) {
    if (err) {
      return console.log(err)
    }
    console.log(response)
  })
}).client({type: 'redis', topic: 'my-topic', pin: {foo: 'one'}})

Server:

'use strict'

let seneca = require('seneca')()
seneca.use('seneca-redis-transport').ready(function () {
  this.add({foo: 'one'}, function (args, done) {
    done(null, {bar: args.bar})
  })
})

seneca.listen({type: 'redis', topic: 'my-topic', pin: {foo: 'one'}})
jreeter commented 8 years ago

@dgonzalez This code seems to work if you run Server with:

'use strict'

let seneca = require('seneca')()
seneca.use('seneca-redis-transport')

seneca.add({foo: 'one'}, function (args, done) {
    done(null, {bar: args.bar})
})

seneca.listen({type: 'redis', topic: 'my-topic', pin: {foo: 'one'}})
dgonzalez commented 8 years ago

It might have been fixed already. I'll have a look. Thanks!

jreeter commented 8 years ago

With that being said if you add an additional pattern to the .add that accepts anything ('*'), then I think there's an issue. The server subscribes to a different pattern than the client acts on.

'use strict'

let seneca = require('seneca')()
seneca.use('seneca-redis-transport')

seneca.add({foo: 'one', bar:'*'}, function (args, done) {
    done(null, {bar: args.bar})
})

seneca.listen({type: 'redis', topic: 'my-topic', pin: {foo: 'one'}})
IRT-fbachmann commented 7 years ago

Pinning does not work for me either. Is there any progress on this topic?