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
SDK version used: <2.0.0-preview004> (Please include the NuGet package version for all involved components)
"features": "GWV2, RootCertificateV2",
Description of the issue
Using 2.0.0-preview004 in GWv2 gateway, call to OpenAsync to IotHub wipes message from IoTHub for the first time when connecting when device is offline before message has been send to IoTHub. It happens at random. Sometimes getting the message in the code, sometimes not. Out of 10 tries 3, worked 7 did not. Apparently this issue supposed to be corrected in GWV2, but it is not. The issue remains.
It works fine when device is already connected to IoTHub when message has been sent.
Code sample exhibiting the issue
private static IotHubDeviceClient _iotHubClient;
try
{
var _connectionString = "HostName=;SharedAccessKeyName=device;SharedAccessKey=;Deviceid=";
IotHubClientAmqpSettings transport = new IotHubClientAmqpSettings();
var options = new IotHubClientOptions
{
RetryPolicy = new IotHubClientFixedDelayRetryPolicy(0, TimeSpan.FromSeconds(3), true)
};
_iotHubClient = new IotHubDeviceClient(_connectionString, options);
Task.Run
(async () =>
{
try
{
await _iotHubClient.OpenAsync();
await _iotHubClient.SetIncomingMessageCallbackAsync(MessageCallback);
}
catch (Exception e)
{
throw;
}
});
}
catch (Exception e)
{
throw new Exception(e.ToString());
}
Andy,
I tried 2.0.0-preview007 with the same exact results. It seems that the
success of getting messages from the IoT hub increased, however messages
are still lost when connecting to the hub for the very first time.
Sebastian Bylinski
Context
Description of the issue
Using 2.0.0-preview004 in GWv2 gateway, call to OpenAsync to IotHub wipes message from IoTHub for the first time when connecting when device is offline before message has been send to IoTHub. It happens at random. Sometimes getting the message in the code, sometimes not. Out of 10 tries 3, worked 7 did not. Apparently this issue supposed to be corrected in GWV2, but it is not. The issue remains.
It works fine when device is already connected to IoTHub when message has been sent.
Code sample exhibiting the issue
private static IotHubDeviceClient _iotHubClient;
try
{
var _connectionString = "HostName=;SharedAccessKeyName=device;SharedAccessKey=;Deviceid=";
}
protected async Task MessageCallback(IncomingMessage message)
{
return MessageAcknowledgement.Abandon;
}
Console log of the issue
The text was updated successfully, but these errors were encountered: