Azure-sdk-for-java: [Service Bus] : [BUG] : delete a subscription isn't sync

Created on 11 Jan 2021  路  4Comments  路  Source: Azure/azure-sdk-for-java

Describe the bug
The removal of a subscription is not synchronize.

Exception or Stack Trace
No stack

To Reproduce
Call the method

  1. deleteSubscription(..., ...)
  2. getSubscription(..., ...)

Subscription always present

Code Snippet

    public void deleteSubscription(String topicName, String subscriptionName) {
        asyncClient.deleteSubscription(topicName, subscriptionName);
    }

Should be :

    public void deleteSubscription(String topicName, String subscriptionName) {
        asyncClient.deleteSubscription(topicName, subscriptionName).block();
    }

Expected behavior
The subscription should be deleted immediately

Screenshots

Setup (please complete the following information):

Additional context
Add any other context about the problem here.

Information Checklist
Kindly make sure that you have added all the following information above and checkoff the required fields otherwise we will treat the issuer as an incomplete report

  • [x] Bug Description Added
  • [x] Repro Steps Added
  • [x] Setup information Added
Client Service Bus customer-reported needs-author-feedback question

All 4 comments

Hello @algra4 , Thank you for opening the issue. Looks like you are using ServiceBusAdministrationAsyncClient . We are using Reactor Programming model for Async Client and you will need to use .block() or subscribe() to execute the call. You can go through this blog which explain this in bit more detail https://devblogs.microsoft.com/azure-sdk/async-programming-with-project-reactor/#using-async-apis-in-the-new-azure-sdk-for-java

If you like to use Sync client instead , Here is an example of how sync client can be created

// Create a administrator client using connection string.
        ServiceBusAdministrationClient client = new ServiceBusAdministrationClientBuilder()
            .connectionString(connectionString)
            .buildClient();

Thank for you response @hemanttanwar 馃憤

But it's normal that in ServiceBusAdministrationClient class, all methods you call the .block() method after you call the asyncClient.

Expect in the method deleteSubscription(String topicName, String subscriptionName) (link to the method).

For this reason, I think it's a "bug" 馃槃

@algra4 Thank you for clarifying information. You are right . We will fix it soon and release it in a week.

This fix is now released . You can download it from here https://search.maven.org/artifact/com.azure/azure-messaging-servicebus .
Closing this issue now.

Was this page helpful?
0 / 5 - 0 ratings