我可以使用他们的官方 SDK从 azure queues接收消息。它工作正常。这是我用来从队列接收消息的片段。
from azure.servicebus import QueueClient
client = QueueClient.from_connection_string(
q_string,
q_name)
msg = None
with client.get_receiver() as queue_receiver:
messages = queue_receiver.fetch_next(max_batch_size=1, timeout=3)
if len(messages) > 0:
msg = messages[0]
print(f"Received {msg.message}")
return msg
如何关闭与队列的连接?我怎样才能做到这一点?azure sdk 有什么功能可用吗?
慕田峪9158850
相关分类