Azure / azure-service-bus-java

☁️ Java client library for Azure Service Bus
https://azure.microsoft.com/services/service-bus
MIT License
60 stars 58 forks source link

Management Operations - Allow CRUD of entities #161

Open blair0011 opened 6 years ago

blair0011 commented 6 years ago

You can ask a subscription what topic it listens to but there is no way to do the inverse. That seems like a small oversight.

yvgopal commented 6 years ago

A topic can have many subscriptions. This SDK doesn't yet support management calls. We have plans to add support for management calls. Until then, you can't just query a topic how many subscriptions it has. Even the API SubscriptionClient.getTopicName() gets the topic name just by splitting the subscription path.

May I know your use case?

blair0011 commented 6 years ago

I have a tenant specific set of compute services which are self configurable, i.e. they create their own Subscriptions and filter rules at first deployment. But I don't want those services to be creating those things if they already exist, so I would like to be able to do a quick query to see if the Subscription exists and act appropriately.

ChristianWolf42 commented 6 years ago

As said unfortunately right now that would require you to use ARM commands with the current Java client. You can typically use those ARM commands at least from CSharp code. A sample is here: https://github.com/Azure/azure-service-bus/tree/master/samples/DotNet/Microsoft.ServiceBus.Messaging/GeoDR. (Please note that the send sample is using our old .net client, the geo dr sample though shows how to use arm calls). We will add the managment library soon. Target is currently early next year. It was concluded based on this: https://github.com/Azure/azure-service-bus-dotnet/issues/65