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

Prevent the use of NSB configuration APIs that aren't applicable to serverless environments #651

Closed
kbaley opened this issue Apr 3, 2023 · 0 comments · Fixed by #717
Closed
Milestone

Comments

@kbaley
Copy link
Member

kbaley commented Apr 3, 2023

The package provides access to the NServiceBus EndpointConfiguration for advanced configuration scenarios. Not all of these configuration options work as expected in an Azure Functions context. Version 4.3.0 of the package introduces a new Roslyn analyzer that detects the use of these configuration options and causes compile-time warnings and errors.

See Roslyn analyzers for Azure Functions in the documentation for information about the affected configuration options.

Describe the suggested improvement

For the AzureFunctions.Worker.ServiceBus package, much of the NServiceBus configuration API has been moved behind the AdvancedConfiguration API to keep users focused on the most common ones. Some of these APIs aren't applicable to a serverless environment but there's nothing stopping someone from using them, sometimes with unpredictable results. Some examples:

  • UseTransport
  • PurgeOnStartup
  • DefineCriticalErrorAction
  • SetDiagnosticsPath
  • LimitMessageProcessingConcurrencyTo
  • MakeInstanceUniquelyAddressable
  • OverrideLocalAddress
  • RouteReplyToThisInstance
  • RouteToThisInstance

Plus some Azure Service Bus transport properties:

  • MaxAutoLockRenewalDuration
  • PrefetchCount
  • PrefetchMultiplier
  • TimeToWaitBeforeTriggeringCircuitBreaker

We should implement a way to ensure these APIs aren't used in production.

Additional Context

A spike for a Roslyn analyzer that throws an error when certain APIs are used can be found here.

@mikeminutillo mikeminutillo added this to the 4.3.0 milestone Sep 18, 2023
@mikeminutillo mikeminutillo changed the title Some advanced NSB configuration APIs aren't applicable to serverless environments Prevent the use of NSB configuration APIs aren't applicable to serverless environments Sep 20, 2023
@mikeminutillo mikeminutillo changed the title Prevent the use of NSB configuration APIs aren't applicable to serverless environments Prevent the use of NSB configuration APIs that aren't applicable to serverless environments Sep 21, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants