users@tyrus.java.net

Re: Deploying a Tyrus server endpoint on an existing Grizzly instance

From: Gert van Spijker <gert.van.spijker_at_intermodaltelematics.com>
Date: Tue, 10 Jan 2017 21:17:51 +0000

Thanks Pavel,

That is exactly the kind of information I was hoping to find.

I am going through your links to see if I can wrap my head around how
this works.

Thanks

Gert

On 01/10/2017 04:54 PM, Pavel Bucek wrote:
> Hi Gert,
>
> it will require some coding, but we did that multiple times already.
>
> You'll need to register GrizzlyServerFilter [1] to existing Grizzly
> instance. Currently, we are doing that via an AddOn [2], which is
> registered here [3].
>
> ~15 months ago, we already did similar thing for JavaOne presentation,
> see [4], project placeholder. It does what you need and much more (it
> shares hk2 ServiceLocator from Jersey to Tyrus, thus making Tyrus
> "hk2" enabled. You don't need that part..)
>
> Hope it helps,
> Pavel
>
> [1]
> https://github.com/tyrus-project/tyrus/blob/master/containers/grizzly-server/src/main/java/org/glassfish/tyrus/container/grizzly/server/GrizzlyServerFilter.java
> [2]
> https://github.com/tyrus-project/tyrus/blob/master/containers/grizzly-server/src/main/java/org/glassfish/tyrus/container/grizzly/server/WebSocketAddOn.java
> [3]
> https://github.com/tyrus-project/tyrus/blob/master/containers/grizzly-server/src/main/java/org/glassfish/tyrus/container/grizzly/server/GrizzlyServerContainer.java#L200
> [4] https://github.com/pavelbucek/placeholder
>
>
>
> On 10/01/2017 17:40, Gert van Spijker wrote:
>> I am contemplating to use Tyrus for Web Sockets support on our
>> existing Java back-end.
>> The back-end is a plain Java 8 application, but sets up a Grizzly
>> server with Jersey Resources registered through a ResourceConfig
>> instance.
>>
>> I am aware of the "tyrus-container-grizzly-server" module, but that
>> would presumably import and set up a separate Grizzly server,
>> possible even with a different version from the one we are already
>> using.
>>
>> How do I go about to set up a Tyrus WebSocket Endpoint on a Grizzly
>> instance shared with Jersey JAX-RS Resources?
>>
>> Thanks
>>
>> Gert van Spijker
>

-- 
Gert van Spijker
CTO Intermodal Telematics