How to configure EventProcessorHost for IotHub?

Damir Dobric Posts

Next talks:

 

    

Follow me on Twitter: #ddobric



 

 

Archives

If you want to read events from EventHub or IotHub on high-scale, you should use EventProcessorHost. This is a concept, which helps implementation of multiple nodes cluster, which consume events from Azure IoT services like EventHub and IotHub.

Howver all samples, which you can find in documentation are related to using of EventProcessorHost in conjunction with EventHub.


  m_EventProcessorHost = new EventProcessorHost(“NodeName”, path, “grp”, iotHubConnectionString, blobConnectionString);
 

Unfortunately, if you use same configuration with IoTHub, this will not work. The reason for this is that, EventProcessorHost will internally try to create table in Azure storage with the same name as path. In a case of IoTHub the path is typically set to “messages/events”. Such table names are not allowed. This is why host will fail in initialization.

Fortunately, you can pass this name as last argument. Following example shows a valid configuration:


  m_EventProcessorHost = new EventProcessorHost(“NodeName”, path, “grp”, iotHubConnectionString, blobConnectionString, "messages-events");
 


Posted Sep 12 2016, 10:56 PM by Damir Dobric
developers.de is a .Net Community Blog powered by daenet GmbH.