Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

EdgeHub: Fix Mqtt address parsing #76

Merged
merged 7 commits into from
Jul 27, 2018

Conversation

varunpuranik
Copy link
Contributor

IoTHub ignores slashes at the end of MQTT telemetry topics, but EdgeHub doesn't. So updating the code to being EdgeHub to parity.

Also adding a Warning if the topic doesn't match any input. I contemplated throwing in this case, but decided against it since the code is fairly generic and I want to make sure this doesn't break any existing scenarios.

darobs
darobs previously approved these changes Jul 27, 2018
@@ -97,9 +97,13 @@ public bool TryParseProtocolMessagePropsFromAddress(IProtocolGatewayMessage mess

if (matches.Count > 1)
{
this.logger.LogWarning($"Topic name {message.Address} matches more than one route. Picking first matching route.");
this.logger.LogWarning($"Topic name {message.Address} matches more than one topic. Picking first matching topic.");
Copy link
Contributor

@aribeironovaes aribeironovaes Jul 27, 2018

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

topic. Picking first matching topic. [](start = 92, length = 36)

Is it really topic or route makes more sense? #Resolved

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

i think both message is a little bit confusing looking it at first. I would suggest changing to: "Topic Name {bla} matches more than one topic in inboundTable (Or something similar)... Same for the message below....


In reply to: 205842887 [](ancestors = 205842887)

Copy link
Contributor Author

@varunpuranik varunpuranik Jul 27, 2018

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It is the topic.. But you may be right, the sentence does seem a bit odd. Let me fix it. #Resolved

aribeironovaes
aribeironovaes previously approved these changes Jul 27, 2018
Copy link
Contributor

@aribeironovaes aribeironovaes left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

:shipit:

@varunpuranik varunpuranik dismissed stale reviews from aribeironovaes and darobs via da50ab6 July 27, 2018 17:34
Copy link
Contributor

@aribeironovaes aribeironovaes left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

:shipit:

@varunpuranik varunpuranik merged commit b19bbb4 into master Jul 27, 2018
@varunpuranik varunpuranik deleted the varunpuranik/fixMqttAddressParsing branch July 27, 2018 19:13
@tkanoh
Copy link

tkanoh commented Aug 24, 2018

Since around August 22, data is no longer sent upstream with the following error.

2018-08-23 03:01:00.912 +00:00 [WRN] [Microsoft.Azure.Devices.Edge.Hub.Mqtt.MessageAddressConverter] - Message address devices/EdgeDeviceID001/modules/dummyModule/messages/events/ matches more than one
topic. Picking first matching topic.
2018-08-23 03:01:00.935 +00:00 [DBG] [Microsoft.Azure.Devices.Edge.Hub.Mqtt.MessagingServiceClient] - Sending message for device Id EdgeDeviceID001/dummyModule
2018-08-23 03:01:00.947 +00:00 [DBG] [Microsoft.Azure.Devices.Edge.Hub.Core.Routing.RoutingEdgeHub] - Received message from EdgeDeviceID001/dummyModule
2018-08-23 03:01:01.345 +00:00 [DBG] [Microsoft.Azure.Devices.Edge.Hub.Core.Storage.MessageStore] - Added message 639c8748-92a0-4061-a82d-afa8042ec89c to store for iothub at offset 0 - messageCount = 0
2018-08-23 03:01:01.372 +00:00 [DBG] [Microsoft.Azure.Devices.Edge.Hub.Core.Storage.MessageStore] - Getting next batch for endpoint iothub starting from 0 with batch size 10.
2018-08-23 03:01:01.481 +00:00 [DBG] [Microsoft.Azure.Devices.Edge.Hub.Core.Storage.MessageStore] - Obtained next batch for endpoint iothub with batch size 1. Next start offset = 1.
2018-08-23 03:01:01.525 +00:00 [DBG] [Microsoft.Azure.Devices.Edge.Hub.Core.Routing.CloudEndpoint] - Sending 1 message(s) upstream.
2018-08-23 03:01:01.570 +00:00 [ERR] [Microsoft.Azure.Devices.Edge.Hub.Core.Routing.CloudEndpoint] - Received message does not contain a device Id

It can send normally, if removed slash at the end of topics as follows.
So, I think that there is something wrong with this correction.

devices/EdgeDeviceID001/modules/dummyModule/messages/events

@aribeironovaes
Copy link
Contributor

Hi @tkanoh . This issue you are seeing is another problem, fixed, but not yet in a release. GitHub Issue for that is: #203
It should be available on next release.

@tkanoh
Copy link

tkanoh commented Aug 30, 2018

We understand.
Thank you for answering.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants