azure-sdk-for-java icon indicating copy to clipboard operation
azure-sdk-for-java copied to clipboard

Add ability to manage rules with the ServiceBusReceiver

Open ZejiaJiang opened this issue 3 years ago • 12 comments

Description

Add new async client responsible for managing rules for a specific topic subscription. The rule manager requires only Listen claims, whereas the ServiceBusAdministrationAsyncClient requires Manage claims. Addresses https://github.com/Azure/azure-sdk-for-java/issues/27711

All SDK Contribution checklist:

  • [x] The pull request does not introduce [breaking changes]
  • [x] CHANGELOG is updated for new features, bug fixes or other significant changes.
  • [x] I have read the contribution guidelines.

General Guidelines and Best Practices

  • [x] Title of the pull request is clear and informative.
  • [x] There are a small number of commits, each of which have an informative message. This means that previously merged commits do not appear in the history of the PR. For more information on cleaning up the commits in your PR, see this page.

Testing Guidelines

  • [x] Pull request includes test coverage for the included changes.

ZejiaJiang avatar Aug 04 '22 09:08 ZejiaJiang

API change check

APIView has identified API level changes in this PR and created following API reviews.

azure-messaging-servicebus

azure-sdk avatar Aug 05 '22 03:08 azure-sdk

@srnagar , can you take a look at the API view for this? .NET, JS have shipped their RuleManagers.. so we're trying to ship the same experience.

conniey avatar Aug 16 '22 00:08 conniey

@ki1729 can you please review this SB pr?

joshfree avatar Sep 07 '22 18:09 joshfree

Hey @JonathanGiles ,could you please take a look at the API view for this? .NET, JS have shipped their RuleManagers.. so we're trying to ship the same experience.

ZejiaJiang avatar Sep 13 '22 00:09 ZejiaJiang

Hey @JonathanGiles ,could you please take a look at the API view for this? .NET, JS have shipped their RuleManagers.. so we're trying to ship the same experience.

I've left one comment for your consideration. Could you also please share a link to the .NET equivalent API, so that I may compare? Thanks.

JonathanGiles avatar Sep 13 '22 01:09 JonathanGiles

@JonathanGiles Thank you, and here is .net related information: .NET issue - https://github.com/Azure/azure-sdk-for-net/issues/25523 .NET PR - https://github.com/Azure/azure-sdk-for-net/pull/27346 class file - https://github.com/Azure/azure-sdk-for-net/blob/main/sdk/servicebus/Azure.Messaging.ServiceBus/src/RuleManager/ServiceBusRuleManager.cs

ZejiaJiang avatar Sep 13 '22 02:09 ZejiaJiang

Why is the API in Java createRule and deleteRule and in .NET it is addRule and removeRule? Is there precedence that we are following here? It seems that what we have in Java is consistent internally at least.

JonathanGiles avatar Sep 13 '22 02:09 JonathanGiles

Why is the API in Java createRule and deleteRule and in .NET it is addRule and removeRule? Is there precedence that we are following here? It seems that what we have in Java is consistent internally at least.

Sorry, I forgot to add the latest PR https://github.com/Azure/azure-sdk-for-net/pull/29407 , in this PR , .net change addRule and removeRule to createRule and deleteRule.

ZejiaJiang avatar Sep 13 '22 05:09 ZejiaJiang

Hi @JonathanGiles , I added another PR above to explain why using the createRule and deleteRule, here is the source code of the rule manager : https://github.com/Azure/azure-sdk-for-net/blob/main/sdk/servicebus/Azure.Messaging.ServiceBus/src/RuleManager/ServiceBusRuleManager.cs you can compare the final version, in case that .NET did some change after the first PR.

ZejiaJiang avatar Sep 14 '22 02:09 ZejiaJiang

This looks good to me. I left one API comment, and I would like to make sure the Service Bus Java folks are all happy with this too before I hit approve. Thanks!

JonathanGiles avatar Sep 18 '22 23:09 JonathanGiles

Jonathon suggest use List in api.dev, refer to other api which return flux in async client, they return IterableStream in sync client, so I return IterableStream instead of List.

@ki1729 @conniey @anuchandy Please take a look again, if all is OK, I can ask @JonathanGiles approve this PR.

ZejiaJiang avatar Sep 19 '22 05:09 ZejiaJiang

Hi @JonathanGiles , I improve the tests following Connie's comments. Could you please take a look again? Thank you!

ZejiaJiang avatar Sep 22 '22 07:09 ZejiaJiang