Hi,
thanks for the responses and explanations! Appreciate it!
Actually, when I asked the question I tried to figure out why I should care about the queue name in order to sent some command and why this process cannot be automated. For example, next couple very simple extensions would simplify my life, so we don't have to worry about configuring proper queue names
public static class ISendEndpointProviderExtensions
{
public static async Task SendCommand<T>(this ISendEndpointProvider endpointProvider, object message) where T : class
{
var queueUri = $"{ConfigurationManager.AppSettings["rabbitmq:host"].TrimEnd('/')}/commands-{typeof(T).FullName}";
var sendEndpoint = await endpointProvider.GetSendEndpoint(new Uri(queueUri));
await sendEndpoint.Send<T>(message);
}
}
public static class IRabbitMqBusFactoryConfiguratorExtensions
{
public static void ReceiveCommand<T>(this IRabbitMqBusFactoryConfigurator configurator, IRabbitMqHost host, Action<IRabbitMqReceiveEndpointConfigurator> configureEndpoint)
{
configurator.ReceiveEndpoint(host, $"commands-{typeof(T).FullName}", configureEndpoint);
}
}