senecajs / seneca-mesh

Mesh your Seneca.js microservices together - no more service discovery!
MIT License
142 stars 47 forks source link

Bases using a domain #101

Open vartana opened 7 years ago

vartana commented 7 years ago

When our Base array contains a domain it fails to connect, it only works with IP.

WORKS:

function custom_bases (seneca, options, bases, next) {
     const dns = require('dns')

     dns.lookup('BaseSystem', function(err, result) {
         console.log(result)
         console.log(result + ':39999')
       next([result + ':39999'])
    })
}

Not Working:

function custom_bases (seneca, options, bases, next) {
     next(['BaseSystem:39999'])
}
danielo515 commented 6 years ago

Really? I'm wich environments? That may be my actual problem!

danielo515 commented 6 years ago

I can confirm that this is actually the problem. I also have to provide a custom_base lookup function to make this work.