servicebusrhino-servicebus

How to configure Rhino Service Bus RemoteAppDomainHost programmatically?


I see a way to configure the DefaultHost with BusConfiguration(), but do not see a way to configure the RemoteAppDomainHost programmatically (without using a rhino.esb config file section).


Solution

  • Override BeginStart from your bootstrapper and call UseConfiguration. Here's sample code that is working for me:

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