我们已在多个Azure Linux VM中安装了sophos。安装了pip,azure服务总线sdk并使用以下代码,我们可以在消息到达队列时使用消息。
from azure.servicebus import QueueClient, Message # Create the QueueClient
queue_client = QueueClient.from_connection_string("<connectionstring>", "taskqueue") # Receive the message from the queue with queue_client.get_receiver() as queue_receiver:
messages = queue_receiver.fetch_next(timeout=3)
for message in messages:
print(message)
message.complete()
我们如何使用窥视锁定模型将多个AV服务器准确地预订到消息队列。窥视锁定可确保如果第一个AV Linux VM拾取消息并启动扫描,则消息应仅与该特定VM保持锁定状态,其他VM均不应拾取该消息。
<< [1-尽管存储队列尚不支持事件,但Service Bus supports Event Grid但目前仅在高级层中。
此外,在服务总线的情况下,SDK默认使用AMQP,它使用全双工开放连接。2&3-
对于队列存储,当一个接收者获取一条消息时,该消息对其他接收者来说是不可见的,直到特定的超时为止。了解有关concurrency in the queue service in the docs的更多信息。对于服务总线,您可以使用peek-lock mode实现相同的效果。在这种情况下,您还可以为延迟的过程续订锁定。