You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The following code hangs at CreateConnection() when placed inside of a WebAPI endpoint using v4.0.0 of RabbitMQ.Client. Confirmed it works with v3.6.5. Further confirmed that the exact same code works when called in Application_Start but not in Application_BeginRequest using v4.0.0.
Using latest ASP.NET WebAPI/OWIN and .NET 4.6.1.
var factory = new ConnectionFactory
{
HostName = "localhost",
UserName = "XXX",
Password = "YYY"
};
string queueName = "ZZZ";
var args = new Dictionary<string, object>();
args.Add("x-dead-letter-exchange", "TTT");
args.Add("x-dead-letter-routing-key", queueName);
string message = "Current time: " + DateTime.Now.ToLongTimeString();
using (var connection = factory.CreateConnection())
using (var channel = connection.CreateModel())
{
channel.QueueDeclare(queueName, true, false, false, args);
var body = Encoding.UTF8.GetBytes(message);
channel.BasicPublish(exchange: "",
routingKey: queueName,
basicProperties: null,
body: body);
}
The text was updated successfully, but these errors were encountered:
I suspect we may have fallen foul of the async/await deadlock problem when using task schedulers other than the default one. I will perform some additional testing using winforms and/or web api to see if I can replicate it.
The following code hangs at CreateConnection() when placed inside of a WebAPI endpoint using v4.0.0 of RabbitMQ.Client. Confirmed it works with v3.6.5. Further confirmed that the exact same code works when called in Application_Start but not in Application_BeginRequest using v4.0.0.
Using latest ASP.NET WebAPI/OWIN and .NET 4.6.1.
The text was updated successfully, but these errors were encountered: