I would like to configure Add bus rider dynamically into a class not into startup. Working well with RabbitMQ. But I don't know how to Add Rider to my bus.
private IBusControl ConfigureBus()
{
var massTransitSection = this.configuration.GetSection("MassTransit");
var url = massTransitSection.GetValue<string>("Url");
var host = massTransitSection.GetValue<string>("Host");
var userName = massTransitSection.GetValue<string>("UserName");
var password = massTransitSection.GetValue<string>("Password");
var busControl =
Bus.Factory.CreateUsingRabbitMq(cfg =>
{
cfg.Host($"rabbitmq://{url}/{host}", configurator =>
{
configurator.Username(userName);
configurator.Password(password);
});
cfg.PublishTopology.BrokerTopologyOptions = PublishBrokerTopologyOptions.MaintainHierarchy;
});
busControl.StartAsync();
return busControl;
}
Thx a lot for your help
Riders cannot be connected after the bus has been configured. Topic endpoints are also not able to be connected after the bus has been configured.