I've got a app.config configuration for Rebus and it works:
<configuration>
<configSections>
<section name="rebus" type="Rebus.Configuration.RebusConfigurationSection, Rebus" />
</configSections>
<rebus address="192.168.10.100" inputQueue="a.messages" errorQueue="a.error" workers="1" maxRetries="10">
<endpoints>
<add messages="ESB_Model" endpoint="a.messages@MyRemoteMachine" />
</endpoints>
</rebus>
</configuration>
After now I want to set the address and endpoint in code instead of configfile:
_adapter = new BuiltinContainerAdapter();
_bus = Configure.With(_adapter)
.Logging(l => l.None())
.Transport(t => t.UseMsmq("a.messages@MyRemoteMachine", "a.error"))
.MessageOwnership(d => d.FromRebusConfigurationSection())
.CreateBus()
.Start();
This is not accepted and I'm not sure how to set the IP-address. Any help would be welcome!