Correlation filter does not allow any messages through
Hi!
First and foremost, thank you for the awesome work on service bus explorer. It's a really helpful tool.
I experience that when trying to create a correlation filter marked as the default filter using service bus explorer, no messages are allowed through the filter. If I create the same correlation filter on a subscription through some quick and dirty C# code it allows messages.
The correlation filter I'm trying to create looks like this:
I've observed the issue in the following versions: 5.0.18 6.0.2
I'm not sure what more to include here.
@ArchiFloyd are these the stesps to repro?
- Create a subscription with a correlation filter (
Property1== 47381) - Publish messages to the topic with the
Property1set to 47381 - Inspect the subscription for the messages
If I create the same correlation filter on a subscription through some quick and dirty C# code it allows messages.
Just to be on the same page, could you share the custom C# code used?
Thank you for the quick reply. I couldn't find a way to directly create a subscription with a correlation filter immediately. So steps are:
- Create a new Subscription
- Delete the default rule
- Create new rule having the correlation filter with Property1 = 47381
- Inspect the subscription for messages.
My hack-ish C#:
var filter = new CorrelationRuleFilter { ApplicationProperties = { ["Property1"] = 47381 } };
var ruleOptions = new CreateRuleOptions { Filter = filter };
var topic = "testtopic"
var subscription = "testsub"
var doesTopicExist = await serviceBusAdministrationClient.TopicExistsAsync(
topic,
cancellationToken);
if (doesTopicExist.HasValue
&& doesTopicExist.Value)
{
var doesSubscriptionExist = await serviceBusAdministrationClient.SubscriptionExistsAsync(
topic,
subscription,
cancellationToken);
if (doesSubscriptionExist.HasValue
&& !doesSubscriptionExist.Value)
{
await serviceBusAdministrationClient.CreateSubscriptionAsync(
new CreateSubscriptionOptions(
topic,
subscription)
{
RequiresSession = true
},
ruleOptions ?? new CreateRuleOptions(),
cancellationToken);
}
}
I suspect the filter is working with a string value rather than numeric.
Send the property value as a string "47381" and you'll see it working.
This could be a bug with SBE that doesn't know how to work with numeric value.
In my case I'm not in control of the producer of the messages, thus, cannot change how it behaves. My consumer is working with the subscription and filter created in C# which is fine to me. Let me know if you need anything from me. I can try to reproduce your findings if need be @SeanFeldman.