Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[BUG] Unable to Create a Service Bus Subscription with Rules #29885

Closed
1 task done
azizabah opened this issue Jul 8, 2022 · 9 comments
Closed
1 task done

[BUG] Unable to Create a Service Bus Subscription with Rules #29885

azizabah opened this issue Jul 8, 2022 · 9 comments
Assignees
Labels
Client This issue points to a problem in the data-plane of the library. customer-reported Issues that are reported by GitHub users external to the Azure organization. question The issue doesn't require a change to the product in order to be resolved. Most issues start as that Service Bus

Comments

@azizabah
Copy link

azizabah commented Jul 8, 2022

Describe the bug
Using the Java SDK, we are not capable of creating a Service Bus Subscription on a topic with rules initially. If you are trying to create a new subscription that would filter on a subset of the data coming to the topic, this is currently not possible without a tiny chance of other data making it onto this subscription because you have follow the following steps:

  • createSubscription()
  • createRule(with filter)
  • deleteRule(for default)

That leaves the potential for messages in a high volume topic to make it to the subscription that shouldn't be there.

Code Snippet

private fun buildSubscriptionWithRules(record: Record) {
        val formattedName = Utils.formatName(record)
        adminClient.createSubscription(configProperties.topic, formattedName, CreateSubscriptionOptions())
        val rule = CreateRuleOptions(SqlRuleFilter("companyId = '${record.company}'"))
        adminClient.createRule(configProperties.topic, "companyFilter", formattedName, rule)
        adminClient.deleteRule(configProperties.topic, formattedName,"\$Default")
    }

Expected behavior
I would expect feature parity with the Azure SDK for .NET. https://github.com/Azure/azure-sdk-for-net/blob/5adaf18bf8e50514f6e10110cf74233a7ea56151/sdk/servicebus/Azure.Messaging.ServiceBus/src/Administration/ServiceBusAdministrationClient.cs#L1927 Notice that you can supply a CreateRuleOptions on creation. This would alleviate the issue.

Setup (please complete the following information):

  • Java/Kotlin 11
  • Spring Boot 2.6.7
  • Azure SDK BOM - 1.1.0
  • com.azure:azure-messaging-servicebus - version powered by BOM

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

  • Bug Description Added
@ghost ghost added needs-triage Workflow: This is a new issue that needs to be triaged to the appropriate team. customer-reported Issues that are reported by GitHub users external to the Azure organization. question The issue doesn't require a change to the product in order to be resolved. Most issues start as that labels Jul 8, 2022
@joshfree joshfree added Service Bus Client This issue points to a problem in the data-plane of the library. labels Jul 11, 2022
@ghost ghost removed the needs-triage Workflow: This is a new issue that needs to be triaged to the appropriate team. label Jul 11, 2022
@joshfree
Copy link
Member

Thanks for filing this github issue, @azizabah. @ki1729 can you please follow up?

/cc @Azure/azsdk-sb-java

@joshfree
Copy link
Member

@ki1729 can you please share an update?

@ki1729
Copy link
Contributor

ki1729 commented Aug 23, 2022

@azizabah I am working on this feature, and I expect this to be released as part of the SDK release cycle next month

@azizabah
Copy link
Author

@joshfree @ki1729 - Any update on this?

@ki1729
Copy link
Contributor

ki1729 commented Oct 31, 2022

@azizabah This change is now merged and should be released as part of version 7.13

@azizabah
Copy link
Author

azizabah commented Nov 1, 2022

@azizabah This change is now merged and should be released as part of version 7.13

@ki1729 - Can you please link the PR to this issue? Thanks.

@ki1729
Copy link
Contributor

ki1729 commented Nov 1, 2022

Sure @azizabah. Here is the PR for the issue: #31804

@ki1729
Copy link
Contributor

ki1729 commented Nov 16, 2022

@azizabah New SDK v7.13 released today supports this capability. Let us know if you have any issues using it.

@ki1729 ki1729 closed this as completed Nov 16, 2022
@azizabah
Copy link
Author

@ki1729 - Will do. Thanks!

@github-actions github-actions bot locked and limited conversation to collaborators Apr 11, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Client This issue points to a problem in the data-plane of the library. customer-reported Issues that are reported by GitHub users external to the Azure organization. question The issue doesn't require a change to the product in order to be resolved. Most issues start as that Service Bus
Projects
None yet
Development

No branches or pull requests

3 participants