[infinispan-issues] [JBoss JIRA] (ISPN-9222) Custom clientListener filters without a need to deploy java code to Infinispan server

Pedro Zapata Fernandez (Jira) issues at jboss.org
Wed Apr 15 06:29:01 EDT 2020


     [ https://issues.redhat.com/browse/ISPN-9222?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Pedro Zapata Fernandez updated ISPN-9222:
-----------------------------------------
    Fix Version/s: 12.0.0.Final


> Custom clientListener filters without a need to deploy java code to Infinispan server
> -------------------------------------------------------------------------------------
>
>                 Key: ISPN-9222
>                 URL: https://issues.redhat.com/browse/ISPN-9222
>             Project: Infinispan
>          Issue Type: Enhancement
>          Components: Documentation, Hot Rod
>    Affects Versions: 9.2.1.Final
>            Reporter: Marek Posolda
>            Assignee: Donald Naro
>            Priority: Major
>              Labels: redhat-summit-18
>             Fix For: 12.0.0.Final
>
>
> Currently JDG has a way to register client listeners for the remote HotRod events. There are also ways to filter the events, so that client listener doesn't receive the filtered events, which it's not interested in. But it looks that filtering currently requires custom code with CacheEventFilterFactory to be available on JDG server side as described in https://access.redhat.com/documentation/en-us/red_hat_jboss_data_grid/7.2/html-single/developer_guide/#filtering_remote_events .
> I was wondering if it's possible to have custom filter, which is able to somehow filter fields of custom objects without a need to deploy custom code to the Infinispan/JDG server? Both the object and CacheEventFilterFactory to not be required on JDG side. AFAIK the protobuf schema could be used to query custom objects on JDG server side without having the code of the objects available on the JDG side? So iwas thinking about something similar.
> More details: Let's assume that on HotRod client side, I have entity like this:
> {code}
> public class UserEntity {
>     private String username;
>     private String email;
>     private String country;
> }
> {code}
> I will be able to create client listener like this (I don't need to deploy "protobuf-factory". It will be available on JDG out of the box):
> {code}
> @org.infinispan.client.hotrod.annotation.ClientListener(filterFactoryName = "protobuf-factory")
> public class CustomLogListener {
>   ...
> }
> {code}
> Then I will be able to use the examples like this to register client listener on client side (just an example how can the filtering "psudo-language" look like):
> Interested just for users from Czech republic:
> {code}
> remoteCache.addClientListener(listener, new String[] { "country.equals('cs')" }, null);
> {code}
> Interested just for users from Czech republic with emails from "@redhat.com":
> {code}
> remoteCache.addClientListener(listener, new String[] { "country.equals('cs') && email.endsWith('@redhat.com')" }, null);
> {code}



--
This message was sent by Atlassian Jira
(v7.13.8#713008)


More information about the infinispan-issues mailing list