Azure-docs: EventHub SDK can't handle IotHub Connection String, so it doesn't support failover

Created on 13 Oct 2020  Â·  11Comments  Â·  Source: MicrosoftDocs/azure-docs

It says to use IotHub connection string when using the EventHub client, in order to have disaster recovery:

"When receiving telemetry messages from the built-in endpoint using either the Event Hub client or event processor host, you should use the IoT hub connection string to establish the connection."

But the EventHub client doesn't support it: https://github.com/Azure/azure-sdk-for-net/issues/7175


Document Details

⚠ Do not edit this section. It is required for docs.microsoft.com ➟ GitHub issue linking.

Pri2 awaiting-product-team-response escalated-product-team iot-husvc product-question triaged

All 11 comments

@felipepessoto Thanks for the feedback. We are investigating the issue and will update you shortly.

Hello @felipepessoto
The comment on the reference thread Link: was it helpful?
_the IoT Hub's Event-Hub-compatible endpoint for receiving device-to-cloud messages is fully Event Hubs compatible. For production environments, the recommended approach is to use Event Processor Host (EPH) as shown in the sample. An EPH makes your solution more robust: see https://docs.microsoft.com/en-us/azure/event-hubs/event-hubs-dotnet-framework-getstarted-receive-eph
That tutorial also shows you how to set up the storage account._

Yes, but it says the opposite of what is in the doc.
The docs says to use the IoTHub connection string (not the "IoT Hub's Event-Hub-compatible endpoint") to be able to use disaster recovery.

If this comment is correct, then we need to change the docs, saying it is not possible to use disaster recovery when using the EventHub client

The context:

We cannot use the IoT Hub connection string directly in an EventHub client app to read events. We have to first fetch the EventHub connection string by using the IoTHub connection string.

Example:

 Console.WriteLine("Requesting Event Hubs connection string...");
 var eventHubsConnectionString = await IotHubConnection.RequestEventHubsConnectionStringAsync(IoTHubConnectionString);

If the above statement is correct, then we have to update/mention this clearly in our IoTHub-documentation

image

@felipepessoto Please confirm if this is what you are looking for?

Yes, it is correct. Would be nice if the SDK handle that automatically, but I understand it doesn't currently support it.

If we need to manually fetch the EventHub connection string, I would add how to handle failovers. How can I identify a failover happened (an specific Exception is thrown?), and what should I do in that case? Fetch the new EventHub connection string and recreate the EventHub client?

Thanks.

Thank you, all are great questions!!!, let me see if I can add those to my followup with the team.

Cool, thanks!

Hello @felipepessoto Just checking back over here, we will update you as soon as possible.

Hello @felipepessoto , Just giving an update here, the Microsoft Product Team is actively working on this, will keep you posted.

No worries, it is not a blocker. It is just to make sure I'm following the best practices.

Hi @SatishBoddu-MSFT, any updates?

Was this page helpful?
0 / 5 - 0 ratings

Related issues

jamesgallagher-ie picture jamesgallagher-ie  Â·  3Comments

spottedmahn picture spottedmahn  Â·  3Comments

ianpowell2017 picture ianpowell2017  Â·  3Comments

DeepPuddles picture DeepPuddles  Â·  3Comments

bdcoder2 picture bdcoder2  Â·  3Comments