private void configureHost(Uri hostUrl)
        {
            _host = ServiceBusFactory.New(config =>
            {
                config.SetPurgeOnStartup(true);
                config.ReceiveFrom(hostUrl);
                config.UseAzureServiceBus();
                config.UseAzureServiceBusRouting();
                config.Subscribe(
                    s => s.Handler <TestMessage>(msg => _messages.Add(msg))
                    );
            });

            var bus = new RoutingConfigurator().Create(_host);

            bus.Start(_host);
        }
        private void ConfigureHost(Uri hostUrl)
        {
            _host = ServiceBusFactory.New(config =>
            {
                config.SetPurgeOnStartup(true);
                config.UseAzureServiceBus(a => a.ConfigureNamespace(AccountDetails.Namespace, h =>
                {
                    h.SetKeyName(AccountDetails.KeyName);
                    h.SetKey(AccountDetails.Key);
                }));
                config.UseAzureServiceBusRouting();
                config.ReceiveFrom(hostUrl);
                config.Subscribe(
                    s => s.Handler <TestMessage>(msg => _messages.Add(msg))
                    );
            });

            var bus = new RoutingConfigurator().Create(_host);

            bus.Start(_host);
        }
        private void ConfigureHost(Uri hostUrl)
        {
            _host = ServiceBusFactory.New(config =>
            {
                config.SetPurgeOnStartup(true);
                config.UseAzureServiceBus(a => a.ConfigureNamespace(AccountDetails.Namespace, h =>
                {
                    h.SetKeyName(AccountDetails.KeyName);
                    h.SetKey(AccountDetails.Key);
                }));
                config.UseAzureServiceBusRouting();
                config.ReceiveFrom(hostUrl);
                config.Subscribe(
                    s => s.Handler<TestMessage>(msg => _messages.Add(msg))
                    );
            });

            var bus = new RoutingConfigurator().Create(_host);
            bus.Start(_host);
        }