Azure ServiceBusqueue- UAMQP的记录错误
我正在使用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 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论