[JBoss JIRA] (ISPN-9222) Custom clientListener filters without a need to deploy java code to Infinispan server
by Donald Naro (Jira)
[ https://issues.redhat.com/browse/ISPN-9222?page=com.atlassian.jira.plugin... ]
Donald Naro updated ISPN-9222:
------------------------------
Sprint: DataGrid Sprint #39
> 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
>
> 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... .
> 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)
4 years, 11 months
[JBoss JIRA] (ISPN-9222) Custom clientListener filters without a need to deploy java code to Infinispan server
by Donald Naro (Jira)
[ https://issues.redhat.com/browse/ISPN-9222?page=com.atlassian.jira.plugin... ]
Donald Naro commented on ISPN-9222:
-----------------------------------
[~mposolda] thanks for reporting this. sorry if it's been left awhile but I'll see that this makes it into the docs.
FYI, in your earlier comment you mentioned making the Developer Guide available in community. You can find it now at https://infinispan.org/docs/stable/titles/developing/developing.html
> 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
>
> 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... .
> 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)
4 years, 11 months
[JBoss JIRA] (ISPN-9222) Custom clientListener filters without a need to deploy java code to Infinispan server
by Donald Naro (Jira)
[ https://issues.redhat.com/browse/ISPN-9222?page=com.atlassian.jira.plugin... ]
Donald Naro updated ISPN-9222:
------------------------------
Component/s: Documentation
> 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
>
> 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... .
> 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)
4 years, 11 months
[JBoss JIRA] (ISPN-9222) Custom clientListener filters without a need to deploy java code to Infinispan server
by Donald Naro (Jira)
[ https://issues.redhat.com/browse/ISPN-9222?page=com.atlassian.jira.plugin... ]
Donald Naro updated ISPN-9222:
------------------------------
Issue Type: Enhancement (was: Task)
> 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: Hot Rod
> Affects Versions: 9.2.1.Final
> Reporter: Marek Posolda
> Assignee: Donald Naro
> Priority: Major
> Labels: redhat-summit-18
>
> 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... .
> 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)
4 years, 11 months
[JBoss JIRA] (ISPN-9222) Custom clientListener filters without a need to deploy java code to Infinispan server
by Donald Naro (Jira)
[ https://issues.redhat.com/browse/ISPN-9222?page=com.atlassian.jira.plugin... ]
Donald Naro reassigned ISPN-9222:
---------------------------------
Assignee: Donald Naro (was: Nistor Adrian)
> 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: Task
> Components: Hot Rod
> Affects Versions: 9.2.1.Final
> Reporter: Marek Posolda
> Assignee: Donald Naro
> Priority: Major
> Labels: redhat-summit-18
>
> 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... .
> 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)
4 years, 11 months
[JBoss JIRA] (ISPN-5093) Granularity of remote event listener implementations doing the same job
by Tristan Tarrant (Jira)
[ https://issues.redhat.com/browse/ISPN-5093?page=com.atlassian.jira.plugin... ]
Tristan Tarrant reassigned ISPN-5093:
-------------------------------------
Assignee: (was: Galder Zamarreño)
> Granularity of remote event listener implementations doing the same job
> -----------------------------------------------------------------------
>
> Key: ISPN-5093
> URL: https://issues.redhat.com/browse/ISPN-5093
> Project: Infinispan
> Issue Type: Enhancement
> Components: Remote Protocols
> Reporter: Galder Zamarreño
> Priority: Major
>
> Currently, if N clients add the same listener to a cache that does the same job, e.g. keeping a near cache consistent, this results in N server-side cluster listeners created, each potentially installed in different nodes. If one of those nodes fails, all clients that had a listener registered to that node will have to find a different node for this listener.
> The downsides of this approach is that there are as many cluster listeners installed as clients have added listeners (or have near cache enabled), which might not very efficient. If a node goes down, all clients that have cluster listeners there need to failover to some other node.
> The advantage of this approach is simplicity of the approach to decide where to add the listener and where to failover to.
> For this type of scenarios, an alternative set up might be worth exploring:
> If all these client side listeners are interested in exactly the same events, and the client ID would be exposed via the RemoteCache API, a server side cluster listener multi-plexing between all these clients could be potentially built. In other words, instead of having N clients register N cluster listeners, the first client would register the cluster listener with a client listener ID, and if more registrations were added with the same client listener ID, the connections would be added to the existing cluster listener implementation.
> The maximise the efficiency of this solution, all clients (even running in different JMVs), given the same client listener ID, should agree upon the node to add the listener in. For a distributed cache, hashing on the cache name would work. For replicated caches, since there's no hashing available, the first node of the view could be used.
> Since the logic to be executed server-side varies between being the first node adding the client listener vs the others, synchronization would be added to make sure that the first invocation only creates the cluster listener, and the others simply add the channel to the listener.
> Failover is a bit more tricky too, because if the node with the cluster listener goes down, all the clients have to failover, which again exposes a 1st vs the others type of logic.
> Advantages of this approach is the reduction in number of cluster listeners and potentially efficiency coming from a single cluster listener implementation server side.
> The disadvantages come from the server side logic to add/failover a cluster listener, which need to take into account if the listener is present or not. Other disadvantages come from needing the clients to use some specific routing for adding listeners for same node.
--
This message was sent by Atlassian Jira
(v7.13.8#713008)
4 years, 11 months