I've been looking at MassTransit for a couple of weeks now and I'm curious about the possibilities. However, I don't seem to be able to get the concepts quite right.
Expected behaviour I wanted to publish message to "direct" exchange with routing key which is bind to two different queue for performing other activities.
When I attempted the same logic using MassTransit for better scalability. I've found MassTransit creates own exchange based on queue name with fanout type.
Classic code to publish message by exchange and routing key
using (var connection = factory.CreateConnection())
{
using (var channel = connection.CreateModel())
{
channel.ExchangeDeclare(exchange, "direct");
var body = Encoding.UTF8.GetBytes(message);
channel.BasicPublish(exchange, routingKey, null, body);
Console.WriteLine(" [x] Sent {0}", message);
}
}
Is there a way to configure direct or topic exchange with routingkey in MassTransit?