Azure ServiceBusqueue- UAMQP的记录错误

发布于 2025-01-27 11:30:50 字数 2197 浏览 2 评论 0原文

我正在使用azure -servicebus软件包从ServiceBusqueue检索消息 - 我的猜测是它已安装uamqp作为依赖关系。

  • azure-serviceBus == 7.6.0
  • uamqp == 1.5.1

在我的脚本运行后,我得到以下错误代码的一吨(数百行)流程以退出代码0(=成功)结束:

AttributeError: 'NoneType' object has no attribute 'debug'
Exception ignored in: 'uamqp.c_uamqp.cMessage.__dealloc__'
AttributeError: 'NoneType' object has no attribute 'debug'
AttributeError: 'NoneType' object has no attribute 'debug'
Exception ignored in: 'uamqp.c_uamqp.cMessage.__dealloc__'
AttributeError: 'NoneType' object has no attribute 'debug'
AttributeError: 'NoneType' object has no attribute 'debug'
...
Original exception was:
Error in sys.excepthook:

Original exception was:
Error in sys.excepthook:

Original exception was:

Process finished with exit code 0

看起来像包uamqp想要使用debug方法记录某些东西,但由于记录器不是,但由于没有这样做实例化?我该如何解决?这是我可以解决的问题还是我需要等待包装的更新?

我的代码:

    from azure.servicebus import (
        ServiceBusClient,
        AutoLockRenewer,
        ServiceBusReceivedMessage,
    )

    # Create connection
    self.current_connection_string = connection_string
    self.current_queue_name = queue_name
    self.service_bus_client = ServiceBusClient.from_connection_string(
            self.current_connection_string
        )
    self.queue_receiver = self.service_bus_client.get_queue_receiver(
            self.current_queue_name, max_wait_time=max_wait_time
        )

    # get messages
    msgs = self.queue_receiver.receive_messages(max_messages_count)
    self.current_open_messages += msgs
    
    # >>> code processing messages ommitted <<<<
    
    # complete messages with a AutoLockRenewer in case the message lock expired in the meantime + close the queue
    autolock_renewer = AutoLockRenewer()
    for msg in self.current_open_messages:
        autolock_renewer.register(
            self.queue_receiver,
            msg,
            max_lock_renewal_duration=100,
        )
        self.queue_receiver.complete_message(msg)
    self.current_open_messages = []

    self.service_bus_client.close()

I'm using the azure-servicebus package to retrieve messages from a ServiceBusQueue - my guess is it installed uamqp as a dependency.

  • azure-servicebus==7.6.0
  • uamqp==1.5.1

After my script runs, I get a ton (hundreds of lines) of the following error codes after which the process finishes with exit code 0 (=succeeds):

AttributeError: 'NoneType' object has no attribute 'debug'
Exception ignored in: 'uamqp.c_uamqp.cMessage.__dealloc__'
AttributeError: 'NoneType' object has no attribute 'debug'
AttributeError: 'NoneType' object has no attribute 'debug'
Exception ignored in: 'uamqp.c_uamqp.cMessage.__dealloc__'
AttributeError: 'NoneType' object has no attribute 'debug'
AttributeError: 'NoneType' object has no attribute 'debug'
...
Original exception was:
Error in sys.excepthook:

Original exception was:
Error in sys.excepthook:

Original exception was:

Process finished with exit code 0

It looks like the package uamqp wants to log something with the debug method, but fails to do so because the logger is not instantiated? How can I fix this? Is this something I can fix or do I need to wait for an update of the package?

My code:

    from azure.servicebus import (
        ServiceBusClient,
        AutoLockRenewer,
        ServiceBusReceivedMessage,
    )

    # Create connection
    self.current_connection_string = connection_string
    self.current_queue_name = queue_name
    self.service_bus_client = ServiceBusClient.from_connection_string(
            self.current_connection_string
        )
    self.queue_receiver = self.service_bus_client.get_queue_receiver(
            self.current_queue_name, max_wait_time=max_wait_time
        )

    # get messages
    msgs = self.queue_receiver.receive_messages(max_messages_count)
    self.current_open_messages += msgs
    
    # >>> code processing messages ommitted <<<<
    
    # complete messages with a AutoLockRenewer in case the message lock expired in the meantime + close the queue
    autolock_renewer = AutoLockRenewer()
    for msg in self.current_open_messages:
        autolock_renewer.register(
            self.queue_receiver,
            msg,
            max_lock_renewal_duration=100,
        )
        self.queue_receiver.complete_message(msg)
    self.current_open_messages = []

    self.service_bus_client.close()

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。
列表为空,暂无数据
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文