I am new to azure SubscriptionClient, I am trying to get the total message count from azure SubscriptionClient with python.
Please try something like the following:
from azure.servicebus import SubscriptionClient
conn_str = "Endpoint=sb://<service-bus-namespace-name>.servicebus.windows.net/;SharedAccessKeyName=RootManageSharedAccessKey;SharedAccessKey=access-key="
topic_name = "test"
subscription_name = "test"
client = SubscriptionClient.from_connection_string(conn_str, subscription_name, topic_name)
props = client.get_properties()
message_count = props['message_count']
print message_count