dapr / dotnet-sdk

Dapr SDK for .NET
Apache License 2.0
1.11k stars 333 forks source link

Proposal: Change loglevel to Warning for duplicate priorities in pubsub topic subscriptions #992

Open arnoldpistorius opened 1 year ago

arnoldpistorius commented 1 year ago

I have multiple TopicAttributes on the same topic with different filters. The priority of the filters doesn't matter, because they don't overlap. Without a priority on the attribute, the SDK will log the error below. In my opinion this should be warning instead of an error, because:

https://github.com/dapr/dotnet-sdk/blob/e6ded69ca440e6767e96e0c128cbb920f1ee4070/src/Dapr.AspNetCore/DaprEndpointRouteBuilderExtensions.cs#L126

Let me know what you think, I can submit a PR if you want.

Yeg-A commented 6 months ago

Do we have to explicitly assign priorities even in scenarios where that isn't relevant?

BC89 commented 2 months ago

I'm seeing the same with the .Net SDK and don't really understand the intent of priorities as it seems required and necessarily unique which is odd.

WhitWaldo commented 1 week ago

Seems like an easy fix in that it's simply not factoring in matches into whether there are duplicates and looking only at component name, route name and priority to make that determination. Adding e.Match to the grouping here would limit showing the error only to those routes that share the same priority and match and thus overlap.