Query/Question
Wondering as to why the .net standard library does not support using parameters of type timeSpan for filters.
I wish to setup a filter that uses a DateTime message property and subtracts it from sys.EnqueuedDateTimeUtc, to determine if it should be processed as a high priority message or not. When 2 dates are subtracted, the result is a TimeSpan value in the filter, because of this the parameter that it needs to be compared to needs to be a TimeSpan. In .net framework it is possible to set a parameter of type TimeSpan, but with .net standard, this is failing.
Why is this not a Bug or a feature Request?
This could be a feature request, if the team is willing to make this change. Right now, making the assumption that the omission was intentional.
Please see: https://stackoverflow.com/questions/56654086/unable-to-set-timespan-based-parameter-on-an-azure-service-bus-subscription-filt for detailed information about the issue and why I am trying to use a TimeSpan parameter.
Thank you for opening this issue! We are routing it to the appropriate team for follow up.
CC: @shahabhijeet
@rajrao - Yes. Timespan is currently not supported by ManagementClient and SqlFilter.Parameters is not supported by SubscriptionClient.
@axisc, would you please add this feature to our Service Bus backlog?
@rajrao, we have added this feature to our backlog. However, due to current priorities, we do not have a date for this feature to be released. If you would like to contribute with support for TimeSpan, we would welcome that and help you with reviewing and releasing your change. Thanks.
@jfggdl I would love to help out. Can you point me to where I should start looking?
ManagementClient would be the client-side, but there might be needed some work on the broker side, which is not available on GitHub. @nemakam could you please confirm?
@rajrao,
Try to set up filter that uses TimeSpan property using some other client (the older .net full framework client maybe). And then try to do ManagementClient.GetRuleAsync() for that particular rule. Place a debug breakpoint here: https://github.com/Azure/azure-sdk-for-net/blob/495cd969f225c80d6637fddc2bb2c5b99c9fb48c/sdk/servicebus/Microsoft.Azure.ServiceBus/src/Filters/SqlFilterExtensions.cs#L22.
And then see how to edit XmlObjectConvertor.ParseValueObject to include support for TimeSpan.
For what it matters, I've started to work on this issue (can be assigned to me if that's helping).
Sorry, I haven't had much time to devote to this
Most helpful comment
For what it matters, I've started to work on this issue (can be assigned to me if that's helping).