On Wed, Jul 23, 2014 at 4:26 AM, Dilini Muthumala <[email protected]> wrote:
> Hi all,
>
> This is regarding the tomcat-7 implementation of web sockets.
>
> When setting up a web socket end point, to receive events from clients,
> the following problem comes up:
>
> Web socket end point must cater two client types:
> 1. Clients who want to publish to a *tenant-specific* end-point (e.g.
> ws://localhost:9763/websocketin*/t/tenant1*/topic1)
> 2. Clients who want to publish to a *super-tenant-owned* end-point (e.g.
> ws://localhost:9763/websocketin/topic1)
>
> How are we going to cater both of these types of connect-requests, using
> the same web socket end point?
>
>
> -------------------------------------------------------------------------------------------------------------------------------------------------------------------------
> *For example,*
>
> To support 'ws://localhost:9763/websocketin/t/tenant1/topic1' like URL
> pattern, we can define the end point as,
> @ServerEndpoint(value = "/t/{tdomain}/{topic}")
>
> In that case, "/t/{tdomain}" is NOT optional.
>
WS Java API does not support for optional path parameters, you can't
achieve above using one WS endpoint instead you need to write two endpoints
as follows.
@ServerEndpoint(value = "/t/{tdomain}/{topic}")
@ServerEndpoint(value = "/{topic}")
BTW please don't duplicate same logic in both classes instead move logic
into common abstract or util class.
Thanks !
>
> As such, a URL pattern like 'ws://localhost:9763/websocketin/topic1' will
> not be valid, since it's missing "/t/{tdomain}".
>
> -------------------------------------------------------------------------------------------------------------------------------------------------------------------------
>
> Any thoughts on how to achieve the subject?
>
> Thanks,
> Dilini
>
> --
> *Dilini Muthumala*
> Software Engineer,
> WSO2 Inc.
>
> *E-mail :* [email protected]
> *Mobile: *+94713 400 029
>
> _______________________________________________
> Dev mailing list
> [email protected]
> http://wso2.org/cgi-bin/mailman/listinfo/dev
>
>
--
Sagara Gunathunga
Senior Technical Lead; WSO2, Inc.; http://wso2.com
V.P Apache Web Services; http://ws.apache.org/
Linkedin; http://www.linkedin.com/in/ssagara
Blog ; http://ssagara.blogspot.com
_______________________________________________
Dev mailing list
[email protected]
http://wso2.org/cgi-bin/mailman/listinfo/dev