seneca-redis-pubsub-transport icon indicating copy to clipboard operation
seneca-redis-pubsub-transport copied to clipboard

Misbehaviour when actions are pinned

Open dgonzalez opened this issue 8 years ago • 5 comments

This is related to (and aggregates):

  • https://github.com/senecajs/seneca-redis-pubsub-transport/issues/8
  • https://github.com/senecajs/seneca-redis-pubsub-transport/issues/19

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

dgonzalez avatar Sep 05 '16 16:09 dgonzalez

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'}})

dgonzalez avatar Sep 05 '16 16:09 dgonzalez

@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'}})

jreeter avatar Nov 01 '16 21:11 jreeter

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

dgonzalez avatar Nov 01 '16 21:11 dgonzalez

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'}})

jreeter avatar Nov 01 '16 21:11 jreeter

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

IRT-fbachmann avatar Feb 03 '17 07:02 IRT-fbachmann