log.info("Creating service registrar for domain: {}", domain);
// TODO: localhost:4999 is pretty specific to Spotify's registrar, this should be
// handled in createForDomain there, rather than here. Localhost should just pass through.
return domain.equals("localhost")
? factory.create("tcp://localhost:4999")
: factory.createForDomain(domain);
} else {
log.info("No address nor domain configured, not creating service registrar.");
return new NopServiceRegistrar();
}