senecajs / seneca-redis-pubsub-transport

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

cannot register an url host #37

Closed nqd closed 7 years ago

nqd commented 7 years ago

May be i am missing something, then i cannot connect to a redis broker except localhost. This is the log from an attempt to connect to a redis url:

["listen","open",{"url":"name://pass@abcxyz.redislabs.com:16832/my-topic","timeout":21667,"type":"redis","host":"localhost","port":6379,"role":"transport","hook":"listen"},{"private$":{},"did":"(vetyo82c85kx)","fixedargs":{"plugin$":{"name":"transport","tag":"-"}},"context":{}}]

This is the setup for the server:

var seneca = require('seneca')({
  transport: {
    redis: {
      // you can use The URL of the Redis server. Format:-
      url: 'name://pass@abcxyz.redislabs.com:16832/my-topic'
    }
  }
})
.use('redis-transport')
.listen({type: 'redis'}

Could you please give me some hint about this issue. Many thanks.

MHabashy10 commented 7 years ago

Hi @nqd

i think the problem with the protocol of the url, as per your example you are using "name" protocol, however it should be 'redis'.

so for your example this url should work (notice the redis instead of name) url: 'redis://pass@abcxyz.redislabs.com:16832/my-topic'

apologies for the late response Regards

nqd commented 7 years ago

oh, it works. thank a lot Mohamed.

MHabashy10 commented 7 years ago

you are welcome 👍 @nqd, glad i could help. 🙂 Cheers.