azuresblite
azuresblite copied to clipboard
Queue message complete error message
Hello
I used this package to UWP app Messages are normally output. But if I call a Complete method failure occurs. I would like to know the cause of the error below. Is it normal that an error?
source
_client = QueueClient.CreateFromConnectionString("Endpoint=sb://aaaa.servicebus.windows.net/;SharedAccessKeyName=listen;SharedAccessKey=aaaa", "d2ctutorial");
OnMessageOptions options = new OnMessageOptions
{
AutoComplete = false,
//AutoRenewTimeout = TimeSpan.FromMinutes(1)
};
_client.OnMessage((message) =>
{
try
{
var bodyStream = message.GetBytes();
string result = Encoding.UTF8.GetString(bodyStream);
//var bodyAsString = new StreamReader(bodyStream, Encoding.ASCII).ReadToEnd();
Debug.WriteLine("Received message: {0} messageId: {1}", result, message.MessageId);
message.Complete();
}
catch (Exception ex)
{
Debug.WriteLine(ex.Message);
}
}, options);
error
Object reference not set to an instance of an object. AzureSBLite.WinRT at ppatierno.AzureSBLite.Messaging.BrokeredMessage.Complete() at UWPSample.ViewModels.WelcomePageViewModel.<>c.<ReceiveIoTHub>b__10_0(BrokeredMessage message)