hazelcast-csharp-client icon indicating copy to clipboard operation
hazelcast-csharp-client copied to clipboard

Listening to Map Entries with Predicates with hazelcast.map.entry.filtering.natural.event.types enabled does not work

Open iozcelik opened this issue 7 years ago • 4 comments

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.

iozcelik avatar Dec 04 '17 14:12 iozcelik

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).

iozcelik avatar Dec 05 '17 06:12 iozcelik

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.

iozcelik avatar Dec 05 '17 07:12 iozcelik

We need to validate hazelcast.map.entry.filtering.natural.event.types works or not. I'll write unit tests for it.

asimarslan avatar Dec 05 '17 11:12 asimarslan

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.

asimarslan avatar Jan 08 '18 11:01 asimarslan

Predicates deprecated.

emreyigit avatar Jun 19 '23 11:06 emreyigit