hazelcast-csharp-client
hazelcast-csharp-client copied to clipboard
Listening to Map Entries with Predicates with hazelcast.map.entry.filtering.natural.event.types enabled does not work
I try to use map listener with predicates like on docs.
I am using .net 3.9 client and I configured my Java (also Hazelcast 3.9) code. But my listeners doesn't fire.
myTestMap.AddEntryListener(new EntryAdapter<string,MyTestMap> { Added = e => ValidateData(e) },new SqlPredicate("Status=2"),true);
When old value does not match predicate, new value matches predicate
writes on document. But any event fire include with have no predicate.
I update version 3.9.1 and try to use EntryAddedListener
. I update code;
myTestMap.AddEntryListener(new TestListener(),new SqlPredicate("Status=2"),true);
public class TestListener: EntryAddedListener<string,MyTestMap> {
public void EntryAdded(EntryEvent<string,MyTestMap> @event) {
ValidateData(@event);
}
}
This time, I get:
Your app has entered a break state, but there is no code to show because all threads were executing external code (typically system or framework code).
Ok, I found the problem and try to fix it.
ClientMapProxy.AddEntryListener(MapListener listener,.....
methods has recursive call so, I get previous exception.
I remove recursive calls and put the code (previous listener code) and it's seem working without predicate. But when using predicate, still is not working.
We need to validate hazelcast.map.entry.filtering.natural.event.types
works or not. I'll write unit tests for it.
We fixed the listener registration making recursive call in v3.9.2.
This issue only represent the natural filtering of events configured on server side with hazelcast.map.entry.filtering.natural.event.types = true
behaviour on .net client side.
See Hazelcast ref manual for the expected behaviour.
Predicates deprecated.