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

[service-bus] topic subscription receives messages even with option status=Disabled #12345

Closed
1 task
xavier-d opened this issue Nov 6, 2020 · 10 comments
Closed
1 task
Assignees
Labels
blocking-release Blocks release 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. feature-request This issue requires a new behavior in the product in order be resolved. Service Bus

Comments

@xavier-d
Copy link

xavier-d commented Nov 6, 2020

  • Package Name: service-bus
  • Package Version: 7.0.0-preview.8
  • Operating system: windows10
  • nodejs
    • version: 10.15.3

Describe the bug
While creating a subscription on a Topic Service Bus with many incoming messages even with disabled status option, messages are received.

To Reproduce

use a service bus with many activity

const serviceBusAdminClient = new ServiceBusAdministrationClient(connectionString);
await serviceBusAdminClient.createSubscription(topicName, subscriptionName,{status: 'Disabled'});
await serviceBusAdminClient.deleteRule(topicName, subscriptionName, '$Default' );

// is there messages?
const serviceBusClient = new ServiceBusClient(connectionString);
const subQueue = serviceBusClient.createReceiver(topicName, subscriptionName);
const msg = await subQueue.receiveMessages(1000,
        {
            receiveMode: "receiveAndDelete",
            maxWaitTimeInMs: 500
        }
    );
 if (msg.length){
        console.log('Already recived messages:',msg.length);
    }

Expected behavior
By setting "Disabled" status we should not have any messages at all.

@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 Nov 6, 2020
@ramya-rao-a ramya-rao-a added Client This issue points to a problem in the data-plane of the library. Service Bus labels Nov 7, 2020
@ghost ghost removed the needs-triage Workflow: This is a new issue that needs to be triaged to the appropriate team. label Nov 7, 2020
@ghost ghost added the needs-team-attention Workflow: This issue needs attention from Azure service team or SDK team label Nov 7, 2020
@HarshaNalluru
Copy link
Member

Thanks for reaching out @xavier-d!
Your sample was helpful, I acknowledge the problem.

We'll check with the service team on the "Disabled" behavior and get back.

@xavier-d
Copy link
Author

xavier-d commented Nov 9, 2020

I was expecting to use this feature in order get only the messages I want; Create the subscription as Disabled then update the rule as I want. 'SendDisabled' option has been tested and not working either.
Another solution would be to configure the default rule during the subscription creation... but not sure if it is a planned feature

@HarshaNalluru
Copy link
Member

As per the service team, EntityStatus only affects SENDs/ RECEIVEs coming from external clients, messages going from topic to subscriptions are not affected by it.

Another solution would be to configure the default rule during the subscription creation... but not sure if it is a planned feature

For your use case, the only solution as of now would be to add a rule after creation.
According to the service team, configuring the rule while creation is supported, JS SDK needs to add support for the same(TODO).
Hopefully, we'll get to it by the next release.

@ramya-rao-a ramya-rao-a added feature-request This issue requires a new behavior in the product in order be resolved. and removed needs-team-attention Workflow: This issue needs attention from Azure service team or SDK team labels Nov 9, 2020
@ghost ghost added the needs-team-attention Workflow: This issue needs attention from Azure service team or SDK team label Nov 9, 2020
@ramya-rao-a ramya-rao-a removed the question The issue doesn't require a change to the product in order to be resolved. Most issues start as that label Nov 9, 2020
@ramya-rao-a ramya-rao-a added this to the [2020] December milestone Nov 9, 2020
@ramya-rao-a ramya-rao-a removed the needs-team-attention Workflow: This issue needs attention from Azure service team or SDK team label Nov 9, 2020
@ramya-rao-a
Copy link
Contributor

Also, may I just say a thank you for trying out our previews!
We appreciate the feedback and look forward to hearing anything else in the future

@HarshaNalluru
Copy link
Member

Keeping the issue open to track the feature support.

@HarshaNalluru
Copy link
Member

#12495 fixes this. Please watch out for the 7.0.0 release for the fix.

@ramya-rao-a
Copy link
Contributor

ramya-rao-a commented Nov 17, 2020

@xavier-d Meanwhile, if you want to try out the changes, you can use our nightly dev build as well. Install the package using npm install @azure/service-bus@dev. The options for the createSubscription() method now take the default rule options as well.

Disclaimer: Do NOT use the dev build in production :)

@HarshaNalluru
Copy link
Member

HarshaNalluru commented Nov 17, 2020

It's(dev version) not released yet. I'll ping once done.

@xavier-d
Copy link
Author

Thanks for the dev.
I'll give a try and keep you posted;

@HarshaNalluru
Copy link
Member

HarshaNalluru commented Nov 18, 2020

The dev version got published 7.0.0-alpha.20201117.3, this version should have the relevant changes to try out.

  const adminClient = new ServiceBusAdministrationClient(connectionString);
  await adminClient.createSubscription("topic-name", "subscription-name", {
    defaultRuleOptions: {
      name: "rule-name",
      filter: { sqlExpression: "1=2" },
    },
  });

openapi-sdkautomation bot pushed a commit to AzureSDKAutomation/azure-sdk-for-js that referenced this issue Jan 21, 2021
[Datadog] Add api version parameter (Azure#12345)
@github-actions github-actions bot locked and limited conversation to collaborators Apr 12, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
blocking-release Blocks release 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. feature-request This issue requires a new behavior in the product in order be resolved. Service Bus
Projects
None yet
Development

No branches or pull requests

3 participants