rogeralsing / Microphone

Apache License 2.0
461 stars 71 forks source link

Add WCF support #43

Open roh85 opened 8 years ago

roh85 commented 8 years ago

I like the idea of Microphone. In our enterprise we have a lot of WCF services. Therefore I am investigating if it is possible to add WCF support to Microphone. I would appreciate it if you would be able to help me getting started by giving me some high level info how to best approach this.

rogeralsing commented 8 years ago

It would absolutely be possible. We might end up using that support too at work as we do have a fair share of WCF there.

This would be the absolute bare minimum to get up and running

var loggerFactory = new LoggerFactory();
var logger = loggerFactory.CreateLogger("Cluster");
var options = new OptionsWrapper<ConsulOptions>(new ConsulOptions
{
    //configure consul here               
});
Cluster.RegisterService(new Uri("http://my.service"),new ConsulProvider(loggerFactory, options),"serviceName","1.0", logger);

You can call this from whatever start up code your service have, e.g. global asax or whatever.

marcofranssen commented 7 years ago

+1