Inconsistent implementation of message and event listening.

classic Classic list List threaded Threaded
7 messages Options
Reply | Threaded
Open this post in threaded view
|

Inconsistent implementation of message and event listening.

Vladimir Ozerov
Hi,

If the same message listener is registered twice for the same topic, it
will be notified twice when message arrives.

For events things are different. If user register listener twice, it will
be invoked only once when event occurrs.

Looks inconsistent and counterintuitive. Looks like we have to handle both
scenarios in the same way. But which way is correct? Thoughts?

Vladimir.
Reply | Threaded
Open this post in threaded view
|

Re: Inconsistent implementation of message and event listening.

dsetrakyan
On Thu, May 7, 2015 at 4:18 AM, Vladimir Ozerov <[hidden email]>
wrote:

> Hi,
>
> If the same message listener is registered twice for the same topic, it
> will be notified twice when message arrives.
>
> For events things are different. If user register listener twice, it will
> be invoked only once when event occurrs.
>
> Looks inconsistent and counterintuitive. Looks like we have to handle both
> scenarios in the same way. But which way is correct? Thoughts?
>

The messaging way sounds more logical to me.


>
> Vladimir.
>
Reply | Threaded
Open this post in threaded view
|

Re: Inconsistent implementation of message and event listening.

Pavel Tupitsyn-3
I also think that messaging is correct and events is not.
If you subscribe n times, you should unsubscribe n times.

On Thu, May 7, 2015 at 4:12 PM, Dmitriy Setrakyan <[hidden email]>
wrote:

> On Thu, May 7, 2015 at 4:18 AM, Vladimir Ozerov <[hidden email]>
> wrote:
>
> > Hi,
> >
> > If the same message listener is registered twice for the same topic, it
> > will be notified twice when message arrives.
> >
> > For events things are different. If user register listener twice, it will
> > be invoked only once when event occurrs.
> >
> > Looks inconsistent and counterintuitive. Looks like we have to handle
> both
> > scenarios in the same way. But which way is correct? Thoughts?
> >
>
> The messaging way sounds more logical to me.
>
>
> >
> > Vladimir.
> >
>



--
--
Pavel Tupitsyn
GridGain Systems, Inc.
www.gridgain.com
Reply | Threaded
Open this post in threaded view
|

Re: Inconsistent implementation of message and event listening.

Valentin Kulichenko
Hmm. How they can be different if they use the same mechanisms of
continuous processor, simply delegating to it? :)

Anyway, my opinion is the same - several subscriptions should mean several
notifications.

--
Val

On Thu, May 7, 2015 at 6:53 AM, Pavel Tupitsyn <[hidden email]>
wrote:

> I also think that messaging is correct and events is not.
> If you subscribe n times, you should unsubscribe n times.
>
> On Thu, May 7, 2015 at 4:12 PM, Dmitriy Setrakyan <[hidden email]>
> wrote:
>
> > On Thu, May 7, 2015 at 4:18 AM, Vladimir Ozerov <[hidden email]>
> > wrote:
> >
> > > Hi,
> > >
> > > If the same message listener is registered twice for the same topic, it
> > > will be notified twice when message arrives.
> > >
> > > For events things are different. If user register listener twice, it
> will
> > > be invoked only once when event occurrs.
> > >
> > > Looks inconsistent and counterintuitive. Looks like we have to handle
> > both
> > > scenarios in the same way. But which way is correct? Thoughts?
> > >
> >
> > The messaging way sounds more logical to me.
> >
> >
> > >
> > > Vladimir.
> > >
> >
>
>
>
> --
> --
> Pavel Tupitsyn
> GridGain Systems, Inc.
> www.gridgain.com
>
Reply | Threaded
Open this post in threaded view
|

Re: Inconsistent implementation of message and event listening.

Vladimir Ozerov
Message listeners are stored in lists (GridIoManager) while event listeners
are stored in sets (GridEventStorageManager).
I do not know for sure whether this affects remote listeners, but this
definitely affects local listeners.

On Thu, May 7, 2015 at 10:42 PM, Valentin Kulichenko <
[hidden email]> wrote:

> Hmm. How they can be different if they use the same mechanisms of
> continuous processor, simply delegating to it? :)
>
> Anyway, my opinion is the same - several subscriptions should mean several
> notifications.
>
> --
> Val
>
> On Thu, May 7, 2015 at 6:53 AM, Pavel Tupitsyn <[hidden email]>
> wrote:
>
> > I also think that messaging is correct and events is not.
> > If you subscribe n times, you should unsubscribe n times.
> >
> > On Thu, May 7, 2015 at 4:12 PM, Dmitriy Setrakyan <[hidden email]
> >
> > wrote:
> >
> > > On Thu, May 7, 2015 at 4:18 AM, Vladimir Ozerov <[hidden email]>
> > > wrote:
> > >
> > > > Hi,
> > > >
> > > > If the same message listener is registered twice for the same topic,
> it
> > > > will be notified twice when message arrives.
> > > >
> > > > For events things are different. If user register listener twice, it
> > will
> > > > be invoked only once when event occurrs.
> > > >
> > > > Looks inconsistent and counterintuitive. Looks like we have to handle
> > > both
> > > > scenarios in the same way. But which way is correct? Thoughts?
> > > >
> > >
> > > The messaging way sounds more logical to me.
> > >
> > >
> > > >
> > > > Vladimir.
> > > >
> > >
> >
> >
> >
> > --
> > --
> > Pavel Tupitsyn
> > GridGain Systems, Inc.
> > www.gridgain.com
> >
>
Reply | Threaded
Open this post in threaded view
|

Re: Inconsistent implementation of message and event listening.

Valentin Kulichenko
Got it. Yes, looks like a bug.

--
Val

On Thu, May 7, 2015 at 12:54 PM, Vladimir Ozerov <[hidden email]>
wrote:

> Message listeners are stored in lists (GridIoManager) while event listeners
> are stored in sets (GridEventStorageManager).
> I do not know for sure whether this affects remote listeners, but this
> definitely affects local listeners.
>
> On Thu, May 7, 2015 at 10:42 PM, Valentin Kulichenko <
> [hidden email]> wrote:
>
> > Hmm. How they can be different if they use the same mechanisms of
> > continuous processor, simply delegating to it? :)
> >
> > Anyway, my opinion is the same - several subscriptions should mean
> several
> > notifications.
> >
> > --
> > Val
> >
> > On Thu, May 7, 2015 at 6:53 AM, Pavel Tupitsyn <[hidden email]>
> > wrote:
> >
> > > I also think that messaging is correct and events is not.
> > > If you subscribe n times, you should unsubscribe n times.
> > >
> > > On Thu, May 7, 2015 at 4:12 PM, Dmitriy Setrakyan <
> [hidden email]
> > >
> > > wrote:
> > >
> > > > On Thu, May 7, 2015 at 4:18 AM, Vladimir Ozerov <
> [hidden email]>
> > > > wrote:
> > > >
> > > > > Hi,
> > > > >
> > > > > If the same message listener is registered twice for the same
> topic,
> > it
> > > > > will be notified twice when message arrives.
> > > > >
> > > > > For events things are different. If user register listener twice,
> it
> > > will
> > > > > be invoked only once when event occurrs.
> > > > >
> > > > > Looks inconsistent and counterintuitive. Looks like we have to
> handle
> > > > both
> > > > > scenarios in the same way. But which way is correct? Thoughts?
> > > > >
> > > >
> > > > The messaging way sounds more logical to me.
> > > >
> > > >
> > > > >
> > > > > Vladimir.
> > > > >
> > > >
> > >
> > >
> > >
> > > --
> > > --
> > > Pavel Tupitsyn
> > > GridGain Systems, Inc.
> > > www.gridgain.com
> > >
> >
>
Reply | Threaded
Open this post in threaded view
|

Re: Inconsistent implementation of message and event listening.

yzhdanov
Ticket has been filed - https://issues.apache.org/jira/browse/IGNITE-879

--Yakov

2015-05-07 23:13 GMT+03:00 Valentin Kulichenko <
[hidden email]>:

> Got it. Yes, looks like a bug.
>
> --
> Val
>
> On Thu, May 7, 2015 at 12:54 PM, Vladimir Ozerov <[hidden email]>
> wrote:
>
> > Message listeners are stored in lists (GridIoManager) while event
> listeners
> > are stored in sets (GridEventStorageManager).
> > I do not know for sure whether this affects remote listeners, but this
> > definitely affects local listeners.
> >
> > On Thu, May 7, 2015 at 10:42 PM, Valentin Kulichenko <
> > [hidden email]> wrote:
> >
> > > Hmm. How they can be different if they use the same mechanisms of
> > > continuous processor, simply delegating to it? :)
> > >
> > > Anyway, my opinion is the same - several subscriptions should mean
> > several
> > > notifications.
> > >
> > > --
> > > Val
> > >
> > > On Thu, May 7, 2015 at 6:53 AM, Pavel Tupitsyn <[hidden email]
> >
> > > wrote:
> > >
> > > > I also think that messaging is correct and events is not.
> > > > If you subscribe n times, you should unsubscribe n times.
> > > >
> > > > On Thu, May 7, 2015 at 4:12 PM, Dmitriy Setrakyan <
> > [hidden email]
> > > >
> > > > wrote:
> > > >
> > > > > On Thu, May 7, 2015 at 4:18 AM, Vladimir Ozerov <
> > [hidden email]>
> > > > > wrote:
> > > > >
> > > > > > Hi,
> > > > > >
> > > > > > If the same message listener is registered twice for the same
> > topic,
> > > it
> > > > > > will be notified twice when message arrives.
> > > > > >
> > > > > > For events things are different. If user register listener twice,
> > it
> > > > will
> > > > > > be invoked only once when event occurrs.
> > > > > >
> > > > > > Looks inconsistent and counterintuitive. Looks like we have to
> > handle
> > > > > both
> > > > > > scenarios in the same way. But which way is correct? Thoughts?
> > > > > >
> > > > >
> > > > > The messaging way sounds more logical to me.
> > > > >
> > > > >
> > > > > >
> > > > > > Vladimir.
> > > > > >
> > > > >
> > > >
> > > >
> > > >
> > > > --
> > > > --
> > > > Pavel Tupitsyn
> > > > GridGain Systems, Inc.
> > > > www.gridgain.com
> > > >
> > >
> >
>