How do I poll the azure service bus to continuously check for the messages? Here is how I receive the message from the queue.
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
I want to continuously look for the message and then process it.