Skip to content
This repository has been archived by the owner on Feb 10, 2021. It is now read-only.

Commit

Permalink
Address #257
Browse files Browse the repository at this point in the history
I am also noticing the same behavior described by @vntampasi in #257
when deploying from the ARM template:

![image](https://user-images.githubusercontent.com/2018336/27145683-457bcd04-50fc-11e7-918f-ded05167ecd3.png)

Able to workaround by adding try / catch around:
` IoTHubHelper.SendMessage(messagePayload["guid"].ToString(),
alertMessage);`
in WebSocketEventProcessor.cs

Attempting to message a device has not implemented a mechanism for
message receipt from the IoT Hub appears to be the reason for failure.
  • Loading branch information
toolboc committed Jun 14, 2017
1 parent 3448f50 commit fbfe8f7
Showing 1 changed file with 9 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -122,7 +122,15 @@ public async Task ProcessEventsAsync(PartitionContext context, IEnumerable<Event

// Send alert to device
var alertMessage = JsonConvert.SerializeObject(messagePayload).ToString();
IoTHubHelper.SendMessage(messagePayload["guid"].ToString(), alertMessage);

try
{
IoTHubHelper.SendMessage(messagePayload["guid"].ToString(), alertMessage);
}
catch (Exception e)
{
Trace.TraceError("Error notifying device {0}, check that message receiving is implemented on the device", messagePayload["guid"].ToString());
}

DateTime time = DateTime.Parse(messagePayload["timecreated"].ToString());
// find the nearest point
Expand Down

0 comments on commit fbfe8f7

Please sign in to comment.