none
Python Azure EventHub Reader. RRS feed

  • Question

  • python version: Python3 

    packages :

    azure==2.0.0rc6

    https://github.com/Azure/azure-event-hubs-python

    Project requirement(objective):

    1.Read the contents (messages) from  Eventhub using python.

    I am able to write messages in Eventhub through Azure web console and python code using azure.servicebus.ServiceBusService module.

    but not able to read the content of azure EventHub.

    When I tried following code example by replacing tokens with appropriate values. 

    https://github.com/Azure/azure-event-hubs-python/blob/master/examples/recv.py

    execution of above code cause following error.

    2018-01-24 17:00:36,675 eventhubs    INFO     eventhubs.pycli-838141af: created the event hub client
    2018-01-24 17:00:36,677 eventhubs    INFO     eventhubs.pycli-838141af: on_reactor_init
    2018-01-24 17:00:36,677 eventhubs    INFO     eventhubs.pycli-838141af: client starts address=XXXX
    Traceback (most recent call last):
      File "hrecv.py", line 53, in <module>
        .subscribe(MyReceiver("1"), CONSUMER_GROUP, "0", OFFSET) \
      File "/usr/local/lib/python3.5/dist-packages/eventhubs-0.1.0-py3.5.egg/eventhubs/__init__.py", line 64, in run
        self.container.run()
      File "/usr/lib/python3/dist-packages/proton/reactor.py", line 133, in run
        while self.process(): pass
      File "/usr/lib/python3/dist-packages/proton/reactor.py", line 156, in process
        self._check_errors()
      File "/usr/lib/python3/dist-packages/proton/reactor.py", line 152, in _check_errors
        _compat.raise_(exc, value, tb)
      File "/usr/lib/python3/dist-packages/proton/_compat.py", line 45, in raise_
        raise v.with_traceback(tb)
      File "/usr/lib/python3/dist-packages/proton/__init__.py", line 3853, in dispatch
        ev.dispatch(self.handler)
      File "/usr/lib/python3/dist-packages/proton/__init__.py", line 3778, in dispatch
        result = dispatch(handler, type.method, self)
      File "/usr/lib/python3/dist-packages/proton/__init__.py", line 3667, in dispatch
        return m(*args)
      File "/usr/local/lib/python3.5/dist-packages/eventhubs-0.1.0-py3.5.egg/eventhubs/__init__.py", line 142, in on_reactor_init
        self.connection = self.container.connect(self.address, reconnect=False, properties=properties)
    TypeError: connect() got an unexpected keyword argument 'properties'

    Kindly make appropriate changes to resolve above errror within https://github.com/Azure/azure-event-hubs-python repo. or

    suggest alternate python module/method to achive above obective.

    Thursday, January 25, 2018 12:16 PM

All replies