Closed ArticOne closed 5 months ago
Thank you, @ArticOne, for the detailed report. Yes you are right.
@ArticOne do you have the chance to test https://github.com/rabbitmq/rabbitmq-stream-dotnet-client/pull/383 ? thank you
@ArticOne do you have the chance to test #383 ? thank you
Sure, I'll try it out a bit later.
Okay, so I manually tryed it out. Should be good now.
I published 90 messages with the old and new version of the producer, with each producing to its own stream like this:
var j = 0ul;
for (int i = 1; i <= 30; i++)
{
var mes = new Message(Encoding.UTF8.GetBytes($"Data V1 - {i}"));
mes.ApplicationProperties = new ApplicationProperties()
{
{ "K1", "V1" }
};
await producer.Send(++j, mes);
}
for (int i = 1; i <= 30; i++)
{
var mes = new Message(Encoding.UTF8.GetBytes($"Data V2 - {i}"));
mes.ApplicationProperties = new ApplicationProperties()
{
{ "K1", "V2" }
};
await producer.Send(++j, mes);
}
for (int i = 1; i <= 30; i++)
{
var mes = new Message(Encoding.UTF8.GetBytes($"Data V3 - {i}"));
mes.ApplicationProperties = new ApplicationProperties()
{
{ "K1", "V3" }
};
await producer.Send(++j, mes);
}
On the consumer side I would enter the filter value ("V1", "V2" or "V3"):
MatchUnfiltered = false
- no messages were received (PostFilter
was never invoked)MatchUnfiltered = true
- all messages were received (PostFilter
was invoked for all of them)MatchUnfiltered = false
- PostFilter
was invoked for few messages (bloom filter's false positives)I also ran the new unit test, it passes.
Additionally, I published the same 90 messages using a regular producer (not the DeduplicatingProducer
one). Interestingly, when consuming from a stream that had messages only from this regular producer, fewer false positives have occured.
Describe the bug
When creating a
DeduplicatingProducer
with a filter, like this:And then consuming from the stream like this:
messages would not be consumed unless
MatchUnfiltered
was set totrue
.Reproduction steps
DeduplicatingProducer
by setting theFilter
property of itsDeduplicatingProducerConfig
to a non null valueConsumer
by setting theFilter
property of itsConsumerFilter
to a non null value while also setting theConsumerFilter
'sMatchUnfiltered
property tofalse
After these steps, published messages would not be consumed.
Expected behavior
When using a
DeduplicatingProducer
with the Filtering feature, I'm expecting the consumer to consume messages based onConsumerFilter.Values
only (not taking the bloom filter's false positives into account).Additional context
Following is a screenshot of a
Create
static method inDeduplicatingProducer
that returns a newDeduplicatingProducer
.When creating a regular
Producer
, whichDeduplicatingProducer
wraps, theFilter
property is not passed fromDeduplicatingProducerConfig
toProducerConfig
.Here's a link that leads to the said static method.