ppatierno / azuresblite

Access to Microsoft Azure Service Bus from all platforms using AMQP protocol
Apache License 2.0
28 stars 10 forks source link

QueueClient.Send never returns, and never sends message #1

Closed lostmsu closed 9 years ago

lostmsu commented 9 years ago

Here's what I do:

var queue = QueueClient.CreateFromConnectionString(connectionString, QueueName);
using(var bodyStream = new MemoryStream())
{
    this.taskSerializer.WriteObject(bodyStream, contentObject);
    bodyStream.Flush();
    bodyStream.Position = 0;
    BrokeredMessage message = new BrokeredMessage(bodyStream);
    message.ContentType = "application/json";
    message.Properties["time"] = DateTime.UtcNow;
    tasksQueue.Send(message);
}

The last Send never returns, and nothing is sent to the queue.

lostmsu commented 9 years ago

I just checked in simple console app, and issue does not seem to repro. It reproes, however, in ASP.NET app. Let me build a minimal repro.

lostmsu commented 9 years ago

Basically, it hangs, when it runs in async Controller method. I wrapped it into Task.Run, and it passes successfully now. Will provide a repro sometime later.

ppatierno commented 9 years ago

It's a normal behavior due to underlying implementation of AMQP .Net Lite library.