IBusControl.Stop() is blocked if called after IBusControl.Publish()

14 views
Skip to first unread message

tamir dresher

unread,
Oct 20, 2016, 9:52:19 AM10/20/16
to masstransit-discuss
Hi
I also posted this as an issue in the github repo: https://github.com/MassTransit/MassTransit/issues/675

When i run the following test it gets blocked and i can't understand why.
I'm using Stop() and not StopAsync() because in our application, the Stop() is used inside a Dispose()method

var queueUri = new Uri($"rabbitmq://localhost/some-queue");

var rabbitMqHostSettings = queueUri.GetHostSettings();
var receiveSettings = queueUri.GetReceiveSettings();

IBusControl bus = Bus.Factory.CreateUsingRabbitMq(sbc =>
{
    var host = sbc.Host(rabbitMqHostSettings);
    sbc.ReceiveEndpoint(host, receiveSettings.QueueName, ep => { });
});

bus.Start();
await bus.Publish(new DummyMessage() { ID = 1 });
bus.Stop();
Reply all
Reply to author
Forward
0 new messages