我有一个 Rebus 的 app.config 配置,它可以工作:
<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>
现在我想在代码而不是配置文件中设置地址和端点:
_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();
这不被接受,我不确定如何设置 IP 地址。欢迎任何帮助!