You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@cxf.apache.org by Daniel Bimschas <bi...@itm.uni-luebeck.de> on 2013/01/04 11:14:16 UTC

Support for WebSockets

Hi there and a happy new year to all of you!

I'm new to CXF and currently trying to run all APIs of my application on top of CXF (JAX-WS, JAX-RS and WebSocket API). Until now, I couldn't find out if there's support for WebSockets in CXF. Is there any?

Being executed in the embedded Jetty it shouldn't be a problem technically... I would also be happy to just have an API to publish a WebSocketServlet directly in the embedded Jetty.

Best regards,
Daniel

Re: Support for WebSockets

Posted by Daniel Bimschas <bi...@itm.uni-luebeck.de>.
On 04.01.2013, at 13:40, Sergey Beryozkin wrote:

> On 04/01/13 15:16, Sergey Beryozkin wrote:
>> Hi Daniel
>> On 04/01/13 14:07, Daniel Bimschas wrote:
>>> Hi Sergey, all,
>>> 
>>> Thank you for your answer Sergey! It seems I'm still figuring out what
>>> CXF actually does and what not (e.g. in comparison to Camel). If I got
>>> it correct now CXF exists to cover Services (i.e. request -> response
>>> pattern) while Camel covers message based applications. Is that correct?
>>> 
>>> In that case I wonder if my question makes any sense with regard to
>>> what I want to realize for my application. My WebSocket API is
>>> message-based, although there's a custom request->response pattern
>>> built on top (in addition to e.g. events being pushed from server to
>>> client).
>>> 
>> Personally I've been thinking more of supporting pushing the events from
>> the server, that would very likely help with getting LogBrowser enhanced
>> but also help users write UIs on top of CXF,
>> 
>> 
>>> My use-case is the following: I want to provide a number of "service
>>> endpoints" like this:
>>> 
>>> SOAP/HTTP-based Web Services (JAX-WS)
>>> http://myserver/soap/v1.0/
>>> http://myserver/soap/v2.0/
>>> 
>>> HTTP-based REST API (JAX-RS)
>>> http://myserver/rest/v1.0/
>>> http://myserver/rest/v2.0/
>>> 
>>> WebSockets message-based API
>>> http://myserver/websocket/v1.0/
>>> http://myserver/websocket/v2.0/
>>> 
>>> Do you have an idea how to tackle this use case in an elegant manner?
>> 
>> I'm not sure at the moment; what is the difference between using JMS and
>> message-based WebSockets ?
> 
> Never mind, I've done a bit of search on it; well, I'm still not sure yest what to recommend :-). What do you think of using web sockets endpoints for ? I guess the more we know about the way users plan to use WebSockets, the easier it will be to plan a possible new transport support,

Right now I use WebSockets to do two things:

 1. push events from server to client
 2. send request messages from client to server and receives responses asynchronously (RPC)

The client is a browser-based application completely written in HTML5/JavaScript.

In more general, less application-specific terms, I could image it would be nice to have WAMP (http://wamp.ws/) support. That should cover most use-cases.

And also, it always nice to provide users with the possibility to use the raw sockets as e.g. described on the Jetty homepage (http://wiki.eclipse.org/Jetty/Feature/WebSockets) so that a user just has to provide callback methods.

Best,
Daniel

> 
> Thanks, Sergey
>>> 
>>> The current implementation I'm trying to refactor is a "grown
>>> architecture" and uses an Jetty with Jersey for JAX-RS, Grizzly with
>>> Metro for JAX-WS and Netty for WebSockets, all servers running on
>>> different ports...
>>> 
>>> Cheers,
>>> Daniel
>>> 
>>> On 04.01.2013, at 11:37, Sergey Beryozkin wrote:
>>> 
>>>> Hi Daniel,
>>>> 
>>>> On 04/01/13 13:14, Daniel Bimschas wrote:
>>>>> Hi there and a happy new year to all of you!
>>>>> 
>>>> Same to you!
>>>>> I'm new to CXF and currently trying to run all APIs of my
>>>>> application on top of CXF (JAX-WS, JAX-RS and WebSocket API). Until
>>>>> now, I couldn't find out if there's support for WebSockets in CXF.
>>>>> Is there any?
>>>>> 
>>>>> Being executed in the embedded Jetty it shouldn't be a problem
>>>>> technically... I would also be happy to just have an API to publish
>>>>> a WebSocketServlet directly in the embedded Jetty.
>>>>> 
>>>> I'm hoping this can be prioritized either in CXF 2.8.x or shortly
>>>> afterwards, ideally earlier than later,
>>>> 
>>>> Andrei wrote a very informative wiki page about creating custom
>>>> transports,
>>>> http://cxf.apache.org/docs/custom-transport.html
>>>> 
>>>> I guess supporting WebSockets would amount to creating a server-only
>>>> transport; I'm not sure yet if it would be better enhancing the
>>>> existing CXF http-jetty transport instead or not
>>>> 
>>>> Cheers, Sergey
>>>> 
>>>>> Best regards,
>>>>> Daniel
>>>> 
>>> 
>> 
> 
> 
> -- 
> Sergey Beryozkin
> 
> Talend Community Coders
> http://coders.talend.com/
> 
> Blog: http://sberyozkin.blogspot.com


Re: Support for WebSockets

Posted by Sergey Beryozkin <sb...@gmail.com>.
On 04/01/13 15:16, Sergey Beryozkin wrote:
> Hi Daniel
> On 04/01/13 14:07, Daniel Bimschas wrote:
>> Hi Sergey, all,
>>
>> Thank you for your answer Sergey! It seems I'm still figuring out what
>> CXF actually does and what not (e.g. in comparison to Camel). If I got
>> it correct now CXF exists to cover Services (i.e. request -> response
>> pattern) while Camel covers message based applications. Is that correct?
>>
>> In that case I wonder if my question makes any sense with regard to
>> what I want to realize for my application. My WebSocket API is
>> message-based, although there's a custom request->response pattern
>> built on top (in addition to e.g. events being pushed from server to
>> client).
>>
> Personally I've been thinking more of supporting pushing the events from
> the server, that would very likely help with getting LogBrowser enhanced
> but also help users write UIs on top of CXF,
>
>
>> My use-case is the following: I want to provide a number of "service
>> endpoints" like this:
>>
>> SOAP/HTTP-based Web Services (JAX-WS)
>> http://myserver/soap/v1.0/
>> http://myserver/soap/v2.0/
>>
>> HTTP-based REST API (JAX-RS)
>> http://myserver/rest/v1.0/
>> http://myserver/rest/v2.0/
>>
>> WebSockets message-based API
>> http://myserver/websocket/v1.0/
>> http://myserver/websocket/v2.0/
>>
>> Do you have an idea how to tackle this use case in an elegant manner?
>
> I'm not sure at the moment; what is the difference between using JMS and
> message-based WebSockets ?

Never mind, I've done a bit of search on it; well, I'm still not sure 
yest what to recommend :-). What do you think of using web sockets 
endpoints for ? I guess the more we know about the way users plan to use 
WebSockets, the easier it will be to plan a possible new transport support,

Thanks, Sergey
>>
>> The current implementation I'm trying to refactor is a "grown
>> architecture" and uses an Jetty with Jersey for JAX-RS, Grizzly with
>> Metro for JAX-WS and Netty for WebSockets, all servers running on
>> different ports...
>>
>> Cheers,
>> Daniel
>>
>> On 04.01.2013, at 11:37, Sergey Beryozkin wrote:
>>
>>> Hi Daniel,
>>>
>>> On 04/01/13 13:14, Daniel Bimschas wrote:
>>>> Hi there and a happy new year to all of you!
>>>>
>>> Same to you!
>>>> I'm new to CXF and currently trying to run all APIs of my
>>>> application on top of CXF (JAX-WS, JAX-RS and WebSocket API). Until
>>>> now, I couldn't find out if there's support for WebSockets in CXF.
>>>> Is there any?
>>>>
>>>> Being executed in the embedded Jetty it shouldn't be a problem
>>>> technically... I would also be happy to just have an API to publish
>>>> a WebSocketServlet directly in the embedded Jetty.
>>>>
>>> I'm hoping this can be prioritized either in CXF 2.8.x or shortly
>>> afterwards, ideally earlier than later,
>>>
>>> Andrei wrote a very informative wiki page about creating custom
>>> transports,
>>> http://cxf.apache.org/docs/custom-transport.html
>>>
>>> I guess supporting WebSockets would amount to creating a server-only
>>> transport; I'm not sure yet if it would be better enhancing the
>>> existing CXF http-jetty transport instead or not
>>>
>>> Cheers, Sergey
>>>
>>>> Best regards,
>>>> Daniel
>>>
>>
>


-- 
Sergey Beryozkin

Talend Community Coders
http://coders.talend.com/

Blog: http://sberyozkin.blogspot.com

Re: Support for WebSockets

Posted by Sergey Beryozkin <sb...@gmail.com>.
Hi Daniel
On 04/01/13 14:07, Daniel Bimschas wrote:
> Hi Sergey, all,
>
> Thank you for your answer Sergey! It seems I'm still figuring out what CXF actually does and what not (e.g. in comparison to Camel). If I got it correct now CXF exists to cover Services (i.e. request ->  response pattern) while Camel covers message based applications. Is that correct?
>
> In that case I wonder if my question makes any sense with regard to what I want to realize for my application. My WebSocket API is message-based, although there's a custom request->response pattern built on top (in addition to e.g. events being pushed from server to client).
>
Personally I've been thinking more of supporting pushing the events from 
the server, that would very likely help with getting LogBrowser enhanced 
but also help users write UIs on top of CXF,


> My use-case is the following: I want to provide a number of "service endpoints" like this:
>
> SOAP/HTTP-based Web Services (JAX-WS)
>    http://myserver/soap/v1.0/
>    http://myserver/soap/v2.0/
>
> HTTP-based REST API (JAX-RS)
>    http://myserver/rest/v1.0/
>    http://myserver/rest/v2.0/
>
> WebSockets message-based API
>    http://myserver/websocket/v1.0/
>    http://myserver/websocket/v2.0/
>
> Do you have an idea how to tackle this use case in an elegant manner?

I'm not sure at the moment; what is the difference between using JMS and 
message-based WebSockets ?

Thanks, Sergey

>
> The current implementation I'm trying to refactor is a "grown architecture" and uses an Jetty with Jersey for JAX-RS, Grizzly with Metro for JAX-WS and Netty for WebSockets, all servers running on different ports...
>
> Cheers,
> Daniel
>
> On 04.01.2013, at 11:37, Sergey Beryozkin wrote:
>
>> Hi Daniel,
>>
>> On 04/01/13 13:14, Daniel Bimschas wrote:
>>> Hi there and a happy new year to all of you!
>>>
>> Same to you!
>>> I'm new to CXF and currently trying to run all APIs of my application on top of CXF (JAX-WS, JAX-RS and WebSocket API). Until now, I couldn't find out if there's support for WebSockets in CXF. Is there any?
>>>
>>> Being executed in the embedded Jetty it shouldn't be a problem technically... I would also be happy to just have an API to publish a WebSocketServlet directly in the embedded Jetty.
>>>
>> I'm hoping this can be prioritized either in CXF 2.8.x or shortly afterwards, ideally earlier than later,
>>
>> Andrei wrote a very informative wiki page about creating custom transports,
>> http://cxf.apache.org/docs/custom-transport.html
>>
>> I guess supporting WebSockets would amount to creating a server-only transport; I'm not sure yet if it would be better enhancing the existing CXF http-jetty transport instead or not
>>
>> Cheers, Sergey
>>
>>> Best regards,
>>> Daniel
>>
>


Re: Support for WebSockets

Posted by Daniel Bimschas <bi...@itm.uni-luebeck.de>.
Hi Sergey, all,

Thank you for your answer Sergey! It seems I'm still figuring out what CXF actually does and what not (e.g. in comparison to Camel). If I got it correct now CXF exists to cover Services (i.e. request -> response pattern) while Camel covers message based applications. Is that correct?

In that case I wonder if my question makes any sense with regard to what I want to realize for my application. My WebSocket API is message-based, although there's a custom request->response pattern built on top (in addition to e.g. events being pushed from server to client).

My use-case is the following: I want to provide a number of "service endpoints" like this:

SOAP/HTTP-based Web Services (JAX-WS)
  http://myserver/soap/v1.0/
  http://myserver/soap/v2.0/

HTTP-based REST API (JAX-RS)
  http://myserver/rest/v1.0/
  http://myserver/rest/v2.0/

WebSockets message-based API
  http://myserver/websocket/v1.0/
  http://myserver/websocket/v2.0/

Do you have an idea how to tackle this use case in an elegant manner?

The current implementation I'm trying to refactor is a "grown architecture" and uses an Jetty with Jersey for JAX-RS, Grizzly with Metro for JAX-WS and Netty for WebSockets, all servers running on different ports...

Cheers,
Daniel

On 04.01.2013, at 11:37, Sergey Beryozkin wrote:

> Hi Daniel,
> 
> On 04/01/13 13:14, Daniel Bimschas wrote:
>> Hi there and a happy new year to all of you!
>> 
> Same to you!
>> I'm new to CXF and currently trying to run all APIs of my application on top of CXF (JAX-WS, JAX-RS and WebSocket API). Until now, I couldn't find out if there's support for WebSockets in CXF. Is there any?
>> 
>> Being executed in the embedded Jetty it shouldn't be a problem technically... I would also be happy to just have an API to publish a WebSocketServlet directly in the embedded Jetty.
>> 
> I'm hoping this can be prioritized either in CXF 2.8.x or shortly afterwards, ideally earlier than later,
> 
> Andrei wrote a very informative wiki page about creating custom transports,
> http://cxf.apache.org/docs/custom-transport.html
> 
> I guess supporting WebSockets would amount to creating a server-only transport; I'm not sure yet if it would be better enhancing the existing CXF http-jetty transport instead or not
> 
> Cheers, Sergey
> 
>> Best regards,
>> Daniel
> 


Re: Support for WebSockets

Posted by Sergey Beryozkin <sb...@gmail.com>.
Hi Daniel,

On 04/01/13 13:14, Daniel Bimschas wrote:
> Hi there and a happy new year to all of you!
>
Same to you!
> I'm new to CXF and currently trying to run all APIs of my application on top of CXF (JAX-WS, JAX-RS and WebSocket API). Until now, I couldn't find out if there's support for WebSockets in CXF. Is there any?
>
> Being executed in the embedded Jetty it shouldn't be a problem technically... I would also be happy to just have an API to publish a WebSocketServlet directly in the embedded Jetty.
>
I'm hoping this can be prioritized either in CXF 2.8.x or shortly 
afterwards, ideally earlier than later,

Andrei wrote a very informative wiki page about creating custom transports,
http://cxf.apache.org/docs/custom-transport.html

I guess supporting WebSockets would amount to creating a server-only 
transport; I'm not sure yet if it would be better enhancing the existing 
CXF http-jetty transport instead or not

Cheers, Sergey

> Best regards,
> Daniel