【问题标题】:How to configure Rhino Service Bus RemoteAppDomainHost programmatically?如何以编程方式配置 Rhino Service Bus RemoteAppDomainHost?
【发布时间】:2012-03-27 02:52:46
【问题描述】:

我看到了一种使用 BusConfiguration() 配置 DefaultHost 的方法,但没有看到一种以编程方式配置 RemoteAppDomainHost 的方法(不使用 rhino.esb 配置文件部分)。

【问题讨论】:

    标签: servicebus rhino-servicebus


    【解决方案1】:
    var cashier = new RemoteAppDomainHost(typeof(CashierBootStrapper))
                    .Configuration("Cashier.config");
    cashier.Start();
    

    https://github.com/BjRo/LearningRhinoServiceBus

    【讨论】:

    • JarretV - 感谢您的回答,但我正在寻找一种避免配置文件的方法。
    【解决方案2】:

    从您的引导程序覆盖 BeginStart 并调用 UseConfiguration。这是对我有用的示例代码:

    public class RemoteAppBootstrapper : AutofacBootStrapper
    {
        protected override void OnBeginStart()
        {
            var busConfiguration = new HostConfiguration()
                .Bus( "msmq://localhost/endpoint.a" )
                .ToBusConfiguration();
    
            UseConfiguration( busConfiguration );
    
            base.OnBeginStart();
        }
    }
    

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2015-03-12
      • 2018-01-23
      • 2016-11-20
      • 2014-12-15
      • 2011-02-17
      • 2012-10-09
      • 1970-01-01
      • 2019-11-16
      相关资源
      最近更新 更多