You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@ignite.apache.org by rajivgandhi <ra...@gmail.com> on 2017/10/27 01:25:16 UTC

Ignite Events Remote Filter

Hi,
We wish to listen to remote events with a remote filter and local listener:
https://apacheignite.readme.io/docs/events#section-remote-events

Our requirement is to entertain only those events on local listener which
are allowed by remote filter. This is the API we are trying to use:
https://ignite.apache.org/releases/latest/javadoc/org/apache/ignite/IgniteEvents.html#remoteListen(org.apache.ignite.lang.IgniteBiPredicate,%20org.apache.ignite.lang.IgnitePredicate,%20int...)

As per this API:
"rmtFilter - Filter callback that is called on remote node. Only events that
pass the remote filter will be sent to local node. If null, all events of
specified types will be sent to local node. This remote filter can be used
to pre-handle events remotely, before they are passed in to local callback.
*It will be auto-unsubsribed on the node where event occurred in case if it
returns false.*"

As per the bolded part, it seems the remote listener will be unsubscribed as
soon as the remote filter returns false. Is that right? We want to be able
to continue listening even after the remote filter has once filtered/blocked
the event on remote nodes. If that is indeed the case (remote filter stops
listening), are there any other work arounds?

thanks!
Rajeev Gandhi






--
Sent from: http://apache-ignite-users.70518.x6.nabble.com/

Re: Ignite Events Remote Filter

Posted by Valentin Kulichenko <va...@gmail.com>.
Alexey,

Yes, seems to be the case. Unsubscription happens if *local listener*
returns false not remote filter.

-Val

On Fri, Oct 27, 2017 at 3:12 AM, Alexey Kukushkin <kukushkinalexey@gmail.com
> wrote:

> Also, I ran our CacheEventsExample and I confirm the remote filter is NOT
> unsubscribed when it returns false. So it looks like a documentation bug
> only.
>
> On Fri, Oct 27, 2017 at 1:10 PM, Alexey Kukushkin <
> kukushkinalexey@gmail.com> wrote:
>
>> Hi,
>>
>> I think it is a documentation bug. I do not think remote listener will be
>> unsubscribed if it returns false. Let's confirm with the developers
>> community.
>>
>> *Ignite Developers*,
>>
>> We have this comment for the remoteListener argument of the
>> IgniteEvents#remoteListen(...):
>>
>> rmtFilter - Filter callback that is called on remote node. Only events
>> that pass the remote filter will be sent to local node. If null, all events
>> of specified types will be sent to local node. This remote filter can be
>> used to pre-handle events remotely, before they are passed in to local
>> callback. *It will be auto-unsubsribed on the node where event occurred
>> in case if it returns false*.
>>
>> The documentation in bold looks like a bug to me. Why we would do it that
>> way? To get only the first event? I think the idea is to listen until
>> either master node leaves or you call remoteUnsubscribe(). I feel we just
>> need to remove that sentence from the comments. Could you please confirm?
>>
>>
>> On Fri, Oct 27, 2017 at 4:25 AM, rajivgandhi <ra...@gmail.com>
>> wrote:
>>
>>> Hi,
>>> We wish to listen to remote events with a remote filter and local
>>> listener:
>>> https://apacheignite.readme.io/docs/events#section-remote-events
>>>
>>> Our requirement is to entertain only those events on local listener which
>>> are allowed by remote filter. This is the API we are trying to use:
>>> https://ignite.apache.org/releases/latest/javadoc/org/apache
>>> /ignite/IgniteEvents.html#remoteListen(org.apache.ignite.
>>> lang.IgniteBiPredicate,%20org.apache.ignite.lang.IgnitePredi
>>> cate,%20int...)
>>>
>>> As per this API:
>>> "rmtFilter - Filter callback that is called on remote node. Only events
>>> that
>>> pass the remote filter will be sent to local node. If null, all events of
>>> specified types will be sent to local node. This remote filter can be
>>> used
>>> to pre-handle events remotely, before they are passed in to local
>>> callback.
>>> *It will be auto-unsubsribed on the node where event occurred in case if
>>> it
>>> returns false.*"
>>>
>>> As per the bolded part, it seems the remote listener will be
>>> unsubscribed as
>>> soon as the remote filter returns false. Is that right? We want to be
>>> able
>>> to continue listening even after the remote filter has once
>>> filtered/blocked
>>> the event on remote nodes. If that is indeed the case (remote filter
>>> stops
>>> listening), are there any other work arounds?
>>>
>>> thanks!
>>> Rajeev Gandhi
>>>
>>>
>>>
>>>
>>>
>>>
>>> --
>>> Sent from: http://apache-ignite-users.70518.x6.nabble.com/
>>>
>>
>>
>>
>> --
>> Best regards,
>> Alexey
>>
>
>
>
> --
> Best regards,
> Alexey
>

Re: Ignite Events Remote Filter

Posted by Valentin Kulichenko <va...@gmail.com>.
Alexey,

Yes, seems to be the case. Unsubscription happens if *local listener*
returns false not remote filter.

-Val

On Fri, Oct 27, 2017 at 3:12 AM, Alexey Kukushkin <kukushkinalexey@gmail.com
> wrote:

> Also, I ran our CacheEventsExample and I confirm the remote filter is NOT
> unsubscribed when it returns false. So it looks like a documentation bug
> only.
>
> On Fri, Oct 27, 2017 at 1:10 PM, Alexey Kukushkin <
> kukushkinalexey@gmail.com> wrote:
>
>> Hi,
>>
>> I think it is a documentation bug. I do not think remote listener will be
>> unsubscribed if it returns false. Let's confirm with the developers
>> community.
>>
>> *Ignite Developers*,
>>
>> We have this comment for the remoteListener argument of the
>> IgniteEvents#remoteListen(...):
>>
>> rmtFilter - Filter callback that is called on remote node. Only events
>> that pass the remote filter will be sent to local node. If null, all events
>> of specified types will be sent to local node. This remote filter can be
>> used to pre-handle events remotely, before they are passed in to local
>> callback. *It will be auto-unsubsribed on the node where event occurred
>> in case if it returns false*.
>>
>> The documentation in bold looks like a bug to me. Why we would do it that
>> way? To get only the first event? I think the idea is to listen until
>> either master node leaves or you call remoteUnsubscribe(). I feel we just
>> need to remove that sentence from the comments. Could you please confirm?
>>
>>
>> On Fri, Oct 27, 2017 at 4:25 AM, rajivgandhi <ra...@gmail.com>
>> wrote:
>>
>>> Hi,
>>> We wish to listen to remote events with a remote filter and local
>>> listener:
>>> https://apacheignite.readme.io/docs/events#section-remote-events
>>>
>>> Our requirement is to entertain only those events on local listener which
>>> are allowed by remote filter. This is the API we are trying to use:
>>> https://ignite.apache.org/releases/latest/javadoc/org/apache
>>> /ignite/IgniteEvents.html#remoteListen(org.apache.ignite.
>>> lang.IgniteBiPredicate,%20org.apache.ignite.lang.IgnitePredi
>>> cate,%20int...)
>>>
>>> As per this API:
>>> "rmtFilter - Filter callback that is called on remote node. Only events
>>> that
>>> pass the remote filter will be sent to local node. If null, all events of
>>> specified types will be sent to local node. This remote filter can be
>>> used
>>> to pre-handle events remotely, before they are passed in to local
>>> callback.
>>> *It will be auto-unsubsribed on the node where event occurred in case if
>>> it
>>> returns false.*"
>>>
>>> As per the bolded part, it seems the remote listener will be
>>> unsubscribed as
>>> soon as the remote filter returns false. Is that right? We want to be
>>> able
>>> to continue listening even after the remote filter has once
>>> filtered/blocked
>>> the event on remote nodes. If that is indeed the case (remote filter
>>> stops
>>> listening), are there any other work arounds?
>>>
>>> thanks!
>>> Rajeev Gandhi
>>>
>>>
>>>
>>>
>>>
>>>
>>> --
>>> Sent from: http://apache-ignite-users.70518.x6.nabble.com/
>>>
>>
>>
>>
>> --
>> Best regards,
>> Alexey
>>
>
>
>
> --
> Best regards,
> Alexey
>

Re: Ignite Events Remote Filter

Posted by rajivgandhi <ra...@gmail.com>.
Thank you Guys!



--
Sent from: http://apache-ignite-users.70518.x6.nabble.com/

Re: Ignite Events Remote Filter

Posted by Alexey Kukushkin <ku...@gmail.com>.
Also, I ran our CacheEventsExample and I confirm the remote filter is NOT
unsubscribed when it returns false. So it looks like a documentation bug
only.

On Fri, Oct 27, 2017 at 1:10 PM, Alexey Kukushkin <kukushkinalexey@gmail.com
> wrote:

> Hi,
>
> I think it is a documentation bug. I do not think remote listener will be
> unsubscribed if it returns false. Let's confirm with the developers
> community.
>
> *Ignite Developers*,
>
> We have this comment for the remoteListener argument of the
> IgniteEvents#remoteListen(...):
>
> rmtFilter - Filter callback that is called on remote node. Only events
> that pass the remote filter will be sent to local node. If null, all events
> of specified types will be sent to local node. This remote filter can be
> used to pre-handle events remotely, before they are passed in to local
> callback. *It will be auto-unsubsribed on the node where event occurred
> in case if it returns false*.
>
> The documentation in bold looks like a bug to me. Why we would do it that
> way? To get only the first event? I think the idea is to listen until
> either master node leaves or you call remoteUnsubscribe(). I feel we just
> need to remove that sentence from the comments. Could you please confirm?
>
>
> On Fri, Oct 27, 2017 at 4:25 AM, rajivgandhi <ra...@gmail.com>
> wrote:
>
>> Hi,
>> We wish to listen to remote events with a remote filter and local
>> listener:
>> https://apacheignite.readme.io/docs/events#section-remote-events
>>
>> Our requirement is to entertain only those events on local listener which
>> are allowed by remote filter. This is the API we are trying to use:
>> https://ignite.apache.org/releases/latest/javadoc/org/apache
>> /ignite/IgniteEvents.html#remoteListen(org.apache.ignite
>> .lang.IgniteBiPredicate,%20org.apache.ignite.lang.Ignit
>> ePredicate,%20int...)
>>
>> As per this API:
>> "rmtFilter - Filter callback that is called on remote node. Only events
>> that
>> pass the remote filter will be sent to local node. If null, all events of
>> specified types will be sent to local node. This remote filter can be used
>> to pre-handle events remotely, before they are passed in to local
>> callback.
>> *It will be auto-unsubsribed on the node where event occurred in case if
>> it
>> returns false.*"
>>
>> As per the bolded part, it seems the remote listener will be unsubscribed
>> as
>> soon as the remote filter returns false. Is that right? We want to be able
>> to continue listening even after the remote filter has once
>> filtered/blocked
>> the event on remote nodes. If that is indeed the case (remote filter stops
>> listening), are there any other work arounds?
>>
>> thanks!
>> Rajeev Gandhi
>>
>>
>>
>>
>>
>>
>> --
>> Sent from: http://apache-ignite-users.70518.x6.nabble.com/
>>
>
>
>
> --
> Best regards,
> Alexey
>



-- 
Best regards,
Alexey

Re: Ignite Events Remote Filter

Posted by Alexey Kukushkin <ku...@gmail.com>.
Also, I ran our CacheEventsExample and I confirm the remote filter is NOT
unsubscribed when it returns false. So it looks like a documentation bug
only.

On Fri, Oct 27, 2017 at 1:10 PM, Alexey Kukushkin <kukushkinalexey@gmail.com
> wrote:

> Hi,
>
> I think it is a documentation bug. I do not think remote listener will be
> unsubscribed if it returns false. Let's confirm with the developers
> community.
>
> *Ignite Developers*,
>
> We have this comment for the remoteListener argument of the
> IgniteEvents#remoteListen(...):
>
> rmtFilter - Filter callback that is called on remote node. Only events
> that pass the remote filter will be sent to local node. If null, all events
> of specified types will be sent to local node. This remote filter can be
> used to pre-handle events remotely, before they are passed in to local
> callback. *It will be auto-unsubsribed on the node where event occurred
> in case if it returns false*.
>
> The documentation in bold looks like a bug to me. Why we would do it that
> way? To get only the first event? I think the idea is to listen until
> either master node leaves or you call remoteUnsubscribe(). I feel we just
> need to remove that sentence from the comments. Could you please confirm?
>
>
> On Fri, Oct 27, 2017 at 4:25 AM, rajivgandhi <ra...@gmail.com>
> wrote:
>
>> Hi,
>> We wish to listen to remote events with a remote filter and local
>> listener:
>> https://apacheignite.readme.io/docs/events#section-remote-events
>>
>> Our requirement is to entertain only those events on local listener which
>> are allowed by remote filter. This is the API we are trying to use:
>> https://ignite.apache.org/releases/latest/javadoc/org/apache
>> /ignite/IgniteEvents.html#remoteListen(org.apache.ignite
>> .lang.IgniteBiPredicate,%20org.apache.ignite.lang.Ignit
>> ePredicate,%20int...)
>>
>> As per this API:
>> "rmtFilter - Filter callback that is called on remote node. Only events
>> that
>> pass the remote filter will be sent to local node. If null, all events of
>> specified types will be sent to local node. This remote filter can be used
>> to pre-handle events remotely, before they are passed in to local
>> callback.
>> *It will be auto-unsubsribed on the node where event occurred in case if
>> it
>> returns false.*"
>>
>> As per the bolded part, it seems the remote listener will be unsubscribed
>> as
>> soon as the remote filter returns false. Is that right? We want to be able
>> to continue listening even after the remote filter has once
>> filtered/blocked
>> the event on remote nodes. If that is indeed the case (remote filter stops
>> listening), are there any other work arounds?
>>
>> thanks!
>> Rajeev Gandhi
>>
>>
>>
>>
>>
>>
>> --
>> Sent from: http://apache-ignite-users.70518.x6.nabble.com/
>>
>
>
>
> --
> Best regards,
> Alexey
>



-- 
Best regards,
Alexey

Re: Ignite Events Remote Filter

Posted by Alexey Kukushkin <ku...@gmail.com>.
Hi,

I think it is a documentation bug. I do not think remote listener will be
unsubscribed if it returns false. Let's confirm with the developers
community.

*Ignite Developers*,

We have this comment for the remoteListener argument of the
IgniteEvents#remoteListen(...):

rmtFilter - Filter callback that is called on remote node. Only events that
pass the remote filter will be sent to local node. If null, all events of
specified types will be sent to local node. This remote filter can be used
to pre-handle events remotely, before they are passed in to local callback. *It
will be auto-unsubsribed on the node where event occurred in case if it
returns false*.

The documentation in bold looks like a bug to me. Why we would do it that
way? To get only the first event? I think the idea is to listen until
either master node leaves or you call remoteUnsubscribe(). I feel we just
need to remove that sentence from the comments. Could you please confirm?


On Fri, Oct 27, 2017 at 4:25 AM, rajivgandhi <ra...@gmail.com> wrote:

> Hi,
> We wish to listen to remote events with a remote filter and local listener:
> https://apacheignite.readme.io/docs/events#section-remote-events
>
> Our requirement is to entertain only those events on local listener which
> are allowed by remote filter. This is the API we are trying to use:
> https://ignite.apache.org/releases/latest/javadoc/org/
> apache/ignite/IgniteEvents.html#remoteListen(org.apache.
> ignite.lang.IgniteBiPredicate,%20org.apache.ignite.lang.
> IgnitePredicate,%20int...)
>
> As per this API:
> "rmtFilter - Filter callback that is called on remote node. Only events
> that
> pass the remote filter will be sent to local node. If null, all events of
> specified types will be sent to local node. This remote filter can be used
> to pre-handle events remotely, before they are passed in to local callback.
> *It will be auto-unsubsribed on the node where event occurred in case if it
> returns false.*"
>
> As per the bolded part, it seems the remote listener will be unsubscribed
> as
> soon as the remote filter returns false. Is that right? We want to be able
> to continue listening even after the remote filter has once
> filtered/blocked
> the event on remote nodes. If that is indeed the case (remote filter stops
> listening), are there any other work arounds?
>
> thanks!
> Rajeev Gandhi
>
>
>
>
>
>
> --
> Sent from: http://apache-ignite-users.70518.x6.nabble.com/
>



-- 
Best regards,
Alexey

Re: Ignite Events Remote Filter

Posted by Alexey Kukushkin <ku...@gmail.com>.
Hi,

I think it is a documentation bug. I do not think remote listener will be
unsubscribed if it returns false. Let's confirm with the developers
community.

*Ignite Developers*,

We have this comment for the remoteListener argument of the
IgniteEvents#remoteListen(...):

rmtFilter - Filter callback that is called on remote node. Only events that
pass the remote filter will be sent to local node. If null, all events of
specified types will be sent to local node. This remote filter can be used
to pre-handle events remotely, before they are passed in to local callback. *It
will be auto-unsubsribed on the node where event occurred in case if it
returns false*.

The documentation in bold looks like a bug to me. Why we would do it that
way? To get only the first event? I think the idea is to listen until
either master node leaves or you call remoteUnsubscribe(). I feel we just
need to remove that sentence from the comments. Could you please confirm?


On Fri, Oct 27, 2017 at 4:25 AM, rajivgandhi <ra...@gmail.com> wrote:

> Hi,
> We wish to listen to remote events with a remote filter and local listener:
> https://apacheignite.readme.io/docs/events#section-remote-events
>
> Our requirement is to entertain only those events on local listener which
> are allowed by remote filter. This is the API we are trying to use:
> https://ignite.apache.org/releases/latest/javadoc/org/
> apache/ignite/IgniteEvents.html#remoteListen(org.apache.
> ignite.lang.IgniteBiPredicate,%20org.apache.ignite.lang.
> IgnitePredicate,%20int...)
>
> As per this API:
> "rmtFilter - Filter callback that is called on remote node. Only events
> that
> pass the remote filter will be sent to local node. If null, all events of
> specified types will be sent to local node. This remote filter can be used
> to pre-handle events remotely, before they are passed in to local callback.
> *It will be auto-unsubsribed on the node where event occurred in case if it
> returns false.*"
>
> As per the bolded part, it seems the remote listener will be unsubscribed
> as
> soon as the remote filter returns false. Is that right? We want to be able
> to continue listening even after the remote filter has once
> filtered/blocked
> the event on remote nodes. If that is indeed the case (remote filter stops
> listening), are there any other work arounds?
>
> thanks!
> Rajeev Gandhi
>
>
>
>
>
>
> --
> Sent from: http://apache-ignite-users.70518.x6.nabble.com/
>



-- 
Best regards,
Alexey