Consuming messages from an Azure Event Hub using Python?

I can't find any documentation online using Python to subscribe and consume messages from the Azure Event Hub. I know this is possible in C, C # and Java. I just need to know if Python can be used.

Currently, the Azure python SDK only supports sending messages, but does not open an Async connection to continuously receive messages from the Event Hub. http://azure-sdk-for-python.readthedocs.org/en/latest/servicebus.html#event-hub

+3


source to share


2 answers


The only way I have found connecting to EventHubs from python is using the python-qpid-proton / pypi library.

This is because eventhubs use amqp 1.0 + TLS, so most other libraries you find won't work (they implement <= amqp 0.9).



I'm still hoping to find a solution that's easier to use with python on Windows, but this should work fine with OS X and Linux.

+3


source


Without knowing the detailed requirements of your dashboard, we can only give you high-level advice. In a nut shell, you can think of your dashboard as a consumer group (or multiple consumer groups if multiple sections are used since each group can only connect to one section). You just need to use AMQP to connect to the event hub. In Python, you can use AMPQ library like https://pypi.python.org/pypi/amqp... Don't worry, after you read the events in your dashboard, the events will not be deleted, so they will still be available to other consumer groups. AMPQ is the standard. So you just need to provide the library with the event hub address, authentication information, and then you can connect to the event hub.



+2


source







All Articles