You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@wicket.apache.org by Thomas Heigl <th...@umschalt.com> on 2020/03/25 16:30:12 UTC

MetaData for websocket connections

Hi all,

I'd like to add metadata to websocket connections. For instance, which
events or channels a connection is subscribed to.

What do you think about adding MetaDataEntry<?>[] metaData to connections
and setMetaData/getMetaData to IWebSocketConnection?

Best regards,

Thomas

Re: MetaData for websocket connections

Posted by Martin Grigorov <mg...@apache.org>.
On Thu, Mar 26, 2020 at 10:59 AM Thomas Heigl <th...@umschalt.com> wrote:

> Hi Martin,
>
> It is not really necessary as you pointed out, but an external registry
> forces me to override the default IWebSocketConnectionRegistry so I can
> update the external registry when connections are
> added and removed.
>

I guess you don't want to use WebSocketBehavior's onConnect() and
onClose/onError() callbacks due to the "avoid loading the page if not
necessary" problem.


>
> If connections themselves would support metadata, there would be no need
> for an external registry plus the required glue code for keeping the
> registry up to date.
>
> But if you prefer not to add functionality I can go ahead and implement an
> external solution and see how it goes.
>

Anyone else having an opinion on this?


>
> Best regards,
>
> Thomas
>
> On Wed, Mar 25, 2020 at 7:19 PM Martin Grigorov <mg...@apache.org>
> wrote:
>
> > Hi Thomas,
> >
> > Is this really necessary?
> > You can achieve the same today by using an external registry.
> > E.g. List<Channel> channels = channelRegistry.get(webSocketConnection);
> > internally the registry can use WebSocketConnection's
> > getApplication().getName(), getSessionId() and getKey() to construct the
> > key.
> >
> > MetaData would do the job as well, but I'd prefer to not add more
> > functionality unless really needed.
> >
> > Regards,
> > Martin
> >
> > On Wed, Mar 25, 2020 at 6:30 PM Thomas Heigl <th...@umschalt.com>
> wrote:
> >
> > > Hi all,
> > >
> > > I'd like to add metadata to websocket connections. For instance, which
> > > events or channels a connection is subscribed to.
> > >
> > > What do you think about adding MetaDataEntry<?>[] metaData to
> connections
> > > and setMetaData/getMetaData to IWebSocketConnection?
> > >
> > > Best regards,
> > >
> > > Thomas
> > >
> >
>

Re: MetaData for websocket connections

Posted by Thomas Heigl <th...@umschalt.com>.
Hi Martin,

It is not really necessary as you pointed out, but an external registry
forces me to override the default IWebSocketConnectionRegistry so I can
update the external registry when connections are
added and removed.

If connections themselves would support metadata, there would be no need
for an external registry plus the required glue code for keeping the
registry up to date.

But if you prefer not to add functionality I can go ahead and implement an
external solution and see how it goes.

Best regards,

Thomas

On Wed, Mar 25, 2020 at 7:19 PM Martin Grigorov <mg...@apache.org>
wrote:

> Hi Thomas,
>
> Is this really necessary?
> You can achieve the same today by using an external registry.
> E.g. List<Channel> channels = channelRegistry.get(webSocketConnection);
> internally the registry can use WebSocketConnection's
> getApplication().getName(), getSessionId() and getKey() to construct the
> key.
>
> MetaData would do the job as well, but I'd prefer to not add more
> functionality unless really needed.
>
> Regards,
> Martin
>
> On Wed, Mar 25, 2020 at 6:30 PM Thomas Heigl <th...@umschalt.com> wrote:
>
> > Hi all,
> >
> > I'd like to add metadata to websocket connections. For instance, which
> > events or channels a connection is subscribed to.
> >
> > What do you think about adding MetaDataEntry<?>[] metaData to connections
> > and setMetaData/getMetaData to IWebSocketConnection?
> >
> > Best regards,
> >
> > Thomas
> >
>

Re: MetaData for websocket connections

Posted by Martin Grigorov <mg...@apache.org>.
Hi Thomas,

Is this really necessary?
You can achieve the same today by using an external registry.
E.g. List<Channel> channels = channelRegistry.get(webSocketConnection);
internally the registry can use WebSocketConnection's
getApplication().getName(), getSessionId() and getKey() to construct the
key.

MetaData would do the job as well, but I'd prefer to not add more
functionality unless really needed.

Regards,
Martin

On Wed, Mar 25, 2020 at 6:30 PM Thomas Heigl <th...@umschalt.com> wrote:

> Hi all,
>
> I'd like to add metadata to websocket connections. For instance, which
> events or channels a connection is subscribed to.
>
> What do you think about adding MetaDataEntry<?>[] metaData to connections
> and setMetaData/getMetaData to IWebSocketConnection?
>
> Best regards,
>
> Thomas
>