Return-Path: X-Original-To: archive-asf-public-internal@cust-asf2.ponee.io Delivered-To: archive-asf-public-internal@cust-asf2.ponee.io Received: from cust-asf.ponee.io (cust-asf.ponee.io [163.172.22.183]) by cust-asf2.ponee.io (Postfix) with ESMTP id EC5B1200C6C for ; Fri, 21 Apr 2017 04:09:18 +0200 (CEST) Received: by cust-asf.ponee.io (Postfix) id E90F0160BB0; Fri, 21 Apr 2017 02:09:18 +0000 (UTC) Delivered-To: archive-asf-public@cust-asf.ponee.io Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by cust-asf.ponee.io (Postfix) with SMTP id E37A8160B9F for ; Fri, 21 Apr 2017 04:09:17 +0200 (CEST) Received: (qmail 44648 invoked by uid 500); 21 Apr 2017 02:09:17 -0000 Mailing-List: contact dev-help@cxf.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@cxf.apache.org Delivered-To: mailing list dev@cxf.apache.org Received: (qmail 44636 invoked by uid 99); 21 Apr 2017 02:09:16 -0000 Received: from pnap-us-west-generic-nat.apache.org (HELO spamd1-us-west.apache.org) (209.188.14.142) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 21 Apr 2017 02:09:16 +0000 Received: from localhost (localhost [127.0.0.1]) by spamd1-us-west.apache.org (ASF Mail Server at spamd1-us-west.apache.org) with ESMTP id 42368CF041 for ; Fri, 21 Apr 2017 02:09:16 +0000 (UTC) X-Virus-Scanned: Debian amavisd-new at spamd1-us-west.apache.org X-Spam-Flag: NO X-Spam-Score: -0.396 X-Spam-Level: X-Spam-Status: No, score=-0.396 tagged_above=-999 required=6.31 tests=[DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, HTML_MESSAGE=2, RCVD_IN_DNSWL_NONE=-0.0001, RCVD_IN_MSPIKE_H2=-2.796, RCVD_IN_SORBS_SPAM=0.5, SPF_PASS=-0.001, URIBL_BLOCKED=0.001] autolearn=disabled Authentication-Results: spamd1-us-west.apache.org (amavisd-new); dkim=pass (2048-bit key) header.d=gmail.com Received: from mx1-lw-us.apache.org ([10.40.0.8]) by localhost (spamd1-us-west.apache.org [10.40.0.7]) (amavisd-new, port 10024) with ESMTP id s6d0y7Korsir for ; Fri, 21 Apr 2017 02:09:14 +0000 (UTC) Received: from mail-io0-f172.google.com (mail-io0-f172.google.com [209.85.223.172]) by mx1-lw-us.apache.org (ASF Mail Server at mx1-lw-us.apache.org) with ESMTPS id D5B135FBB0 for ; Fri, 21 Apr 2017 02:09:13 +0000 (UTC) Received: by mail-io0-f172.google.com with SMTP id a103so98519806ioj.1 for ; Thu, 20 Apr 2017 19:09:13 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:message-id:mime-version:subject:date:references:to:in-reply-to; bh=JH7WAoHOiN5MZC1gF4jPyOh9qkya59aiT0tpny4PFFM=; b=TTff6VAbH8v2WOQRNkO0P3ny2S7CFfpsOaMWygrA1joKd/25PyzsPjSIBuEZrH7V5S f0X05hmcqSfEHh1dGI1HbKc834nwd4zgMkJtE9ZnhMmoZ06TwB7qi0aULAK3MrQsT01g Q+jJLQ8C7x51JQHf/pU4sE8RVFp6+FNPGps0eKf0Qam/qDKpd8ikZwJ2uiDk+eQLos53 phBL10RKrUdkLSK65KheGDHJGw/F0+VwhciLziGAPfWqfyR0u6I2/rjGKAF7J1ZAVk0c yPmgbCgrHrb4wu6apB2k2Q9Bk5q7Lkn+1JEXW7jQu54RsGECrwcrTKfefTs/k61ylQBo JD5w== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:message-id:mime-version:subject:date :references:to:in-reply-to; bh=JH7WAoHOiN5MZC1gF4jPyOh9qkya59aiT0tpny4PFFM=; b=ClyW9XEAs77oVLAD00qhnQauKta5NVwJFM2pOGo12plQYJPBiUxOTipFFsgbB5J1yV fd1SYUa3NWmdWaHWGWBbtX2pcgSYfYO4bfY05/OqgTeNM385+XDuEedFIQoE/ML47vwQ 1WLyte7Cj4QiujegtF1XpvrSyBZjmzI2duw9EBBPoKeRGkqB0yiVIqWVBpakQmwCkYQw nF0oaIU3LuVgIJ8I0j6z0kYAJZXbs6J7v2qiZMPE1bQSLvcyXknljOCMk07w2ziyJvEA uu9RInOPkLujOYO1dRFqTtBgmIuNKLI7RqEro3YisHdGP0N0xmP11VS9OIPEMmJqjC/e DVWg== X-Gm-Message-State: AN3rC/76rm7IpLPASFfEi2IUSH/6B0C7bM04+RohOJgn2rSTDqSvFO3p tSN/elRNobEfQpIk X-Received: by 10.107.166.194 with SMTP id p185mr13559054ioe.15.1492740553066; Thu, 20 Apr 2017 19:09:13 -0700 (PDT) Received: from [10.210.5.168] ([209.132.188.81]) by smtp.gmail.com with ESMTPSA id 139sm3536647ioz.2.2017.04.20.19.09.09 for (version=TLS1 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Thu, 20 Apr 2017 19:09:12 -0700 (PDT) From: Freeman Fang Content-Type: multipart/alternative; boundary="Apple-Mail=_1D3B789A-9102-4ADF-B468-3649FB3A9889" Message-Id: Mime-Version: 1.0 (Mac OS X Mail 8.2 \(2098\)) Subject: Re: [DISCUSS]websocket transport with undertow? Date: Fri, 21 Apr 2017 10:09:24 +0800 References: <08456e13-668a-e3b0-88c1-b68bbf9dea55@gmail.com> <8D1F7E88-82B0-4E9E-9A0E-B2D3B206F0D4@gmail.com> <2ebd9ef5-c4b6-5489-e504-9cc347981444@gmail.com> <311dbd65-1c2c-5b13-91a5-56707db74f51@gmail.com> <57c7ff16-fd64-bdd0-392c-80367323d3a6@gmail.com> <64FD0053-8206-4659-9AD9-08337F577C04@gmail.com> <61c8578d-b131-3f61-2bdd-0f2759874ec9@gmail.com> To: dev@cxf.apache.org In-Reply-To: <61c8578d-b131-3f61-2bdd-0f2759874ec9@gmail.com> X-Mailer: Apple Mail (2.2098) archived-at: Fri, 21 Apr 2017 02:09:19 -0000 --Apple-Mail=_1D3B789A-9102-4ADF-B468-3649FB3A9889 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset=utf-8 Thanks Sergey! Merged to the master. Cheers =EF=BC=8D=EF=BC=8D=EF=BC=8D=EF=BC=8D=EF=BC=8D=EF=BC=8D=EF=BC=8D=EF=BC=8D=EF= =BC=8D=EF=BC=8D=EF=BC=8D=EF=BC=8D=EF=BC=8D Freeman(Yue) Fang Red Hat, Inc.=20 FuseSource is now part of Red Hat > On Apr 20, 2017, at 7:41 PM, Sergey Beryozkin = wrote: >=20 > Hi Freeman >=20 > Thanks, looks like it is all very much consistent with the way either = Servlet (JSR356) or Container-specific (Jetty and now Undertow) = WebSocket support is activated, nice work >=20 > Thanks, Sergey > On 20/04/17 07:18, Freeman Fang wrote: >> Hi Sergey, >>=20 >> I just pushed my commit to websocket-undertow branch. >>=20 >> The main purpose is for the standalone CXF endpoint(not CXF endpoint = deployed into servlet container, as the = AtmosphereWebSocketServletDestination should work with all servlet = container implementing JSR365 now), using = AtmosphereWebSocketUndertowDestination or UndertowWebSocketDestination = when jetty isn=E2=80=99t available on the class path. The original = AtmosphereWebSocketJettyDestination still use jetty to handle the = transport level stuff like read request and send response. Now in the = WebSocketDestinationFactory I check if the jetty is available, keep = things work as is, but if there=E2=80=99s no jetty on the class path but = instead undertow available, use the undertow counterpart ones. The logic = here is quiet similar as before, when Atmosphere is available, use = AtmosphereWebSocketXXXXDestination, if there=E2=80=99s no Atmosphere, = just use XXXXXXWebSocketDestination to create websocket connection and = handle the incoming websocket request. The test cases are also added to = guarantee it works. >>=20 >> Please let me know your thoughts. >> Thanks >>=20 >> =EF=BC=8D=EF=BC=8D=EF=BC=8D=EF=BC=8D=EF=BC=8D=EF=BC=8D=EF=BC=8D=EF=BC=8D= =EF=BC=8D=EF=BC=8D=EF=BC=8D=EF=BC=8D=EF=BC=8D >> Freeman(Yue) Fang >>=20 >> Red Hat, Inc. >> FuseSource is now part of Red Hat >>=20 >>=20 >>=20 >>> On Feb 28, 2017, at 10:07 PM, Sergey Beryozkin = wrote: >>>=20 >>> Hey Freeman >>>=20 >>> You can with a JAXRSClientServerWebSocketTest (copy it to the = undertow systests), add a CXF websocket transport dep and see if it can = already work. Next try JAXRSClientServerWebSocketSpringWebAppTest in the = undertow tests... >>>=20 >>> Cheers, Sergey >>> On 28/02/17 13:44, Sergey Beryozkin wrote: >>>> Hi Freeman, >>>>=20 >>>> yeah, please try your new module idea on the branch and see if you = can >>>> make a JAXRS sys test working with it, but also >>>> try to run a websocket web demo with Tomcat 7 first to confirm it = is >>>> working, then with Tomcat 8 and somehow get it actually running = :-), and >>>> I think if you make it happen then it will also work with Undertow >>>>=20 >>>> Thanks, Sergey >>>> On 28/02/17 13:39, Sergey Beryozkin wrote: >>>>> Hi Freeman >>>>> On 28/02/17 13:12, Freeman Fang wrote: >>>>>> Hi Sergey, >>>>>>=20 >>>>>> Thanks for the detailed response. >>>>>>=20 >>>>>> I wanna add websocket transport with undertow because just like = jetty, >>>>>> we have http-jetty transport and we have websocket transport with >>>>>> jetty websocket implementation. >>>>>=20 >>>>> We don't have a web socket transport with a Jetty web socket >>>>> implementation. We have a web socket transport which can use = Atmosphere >>>>> and it is is not available - then *delegates* to a Jetty = implementation >>>>> if it is available. Please have a look at the code. >>>>>=20 >>>>> And the most important thing is, this CXF web socket transport = makes >>>>> sure that irrespectively of which WebSocket implementation is = loaded it >>>>> does the proper formatting of the response and processing of the = request >>>>> as per the CXF docs/tests/demos which is what you'd need to = duplicate >>>>> somehow otherwise. >>>>>=20 >>>>>=20 >>>>>> As we also have http-undertow transport and so have websocket >>>>>> transport with undertow websocket implementation should make = sense IMHO. >>>>>>=20 >>>>>> And yeah, the websocket transport with undertow websocket >>>>>> implementation should be just as its counterpart, the websocket >>>>>> transport with jetty websocket implementation do. >>>>>>=20 >>>>>> And yes, undertow implement JSR356, but I=E2=80=99m more looking = at the >>>>>> embedded undertow server which can support the websocket, not = sure how >>>>>> the JSR356 code can kick in here though. >>>>>>=20 >>>>> If Undertow implements JSR356 then the CXF WebSocket Transport can = or >>>>> should be able to load it which is what I was referring to. >>>>> For example, a CXF WebSocket demo works with Tomcat 7 but we do = not have >>>>> any Tomcat code in CXF not we use Jetty in that case, see what I = mean ? >>>>> If it gets fixed to work in Tomcat 8 then it will also work with >>>>> Undertow JSR356 which I expect to be effectively a wrapper around >>>>> Undertow internal WebSocket code. IMHO it is really worth = pursuing. >>>>>=20 >>>>> Otherwise you'd have something like undertow_websocket which would >>>>> duplicate a fair bit of the existing CXF web socket transport = code. >>>>>=20 >>>>> Think about it please, if we can avoid adding one more module by >>>>> enhancing the existing one and achieving the same result for CXF >>>>> endpoints using WebSocket on top of Undertow then it will be good = IMHO... >>>>>=20 >>>>> You can try and go a new module route and add say a JAXRS Undertow >>>>> WebSocket test by copying one of the existing JAXRS web socket = tests >>>>> on a new branch and we can discuss it further - I hope once you = end up >>>>> doing it you will see why enhancing the existing Web Socket = transport >>>>> may be better :-). >>>>>=20 >>>>> If we can have the existing transport enhanced to load JSR356s = correctly >>>>> then we can get rid of the Jetty delegation code, have only = Atmosphere >>>>> linking to Tomcat/Jetty/Netty/Undertow JSR356s... >>>>>=20 >>>>> Sergey >>>>>=20 >>>>>=20 >>>>>=20 >>>>>=20 >>>>>> Best Regards >>>>>> =EF=BC=8D=EF=BC=8D=EF=BC=8D=EF=BC=8D=EF=BC=8D=EF=BC=8D=EF=BC=8D=EF=BC= =8D=EF=BC=8D=EF=BC=8D=EF=BC=8D=EF=BC=8D=EF=BC=8D >>>>>> Freeman(Yue) Fang >>>>>>=20 >>>>>> Red Hat, Inc. >>>>>> FuseSource is now part of Red Hat >>>>>>=20 >>>>>>=20 >>>>>>=20 >>>>>>> On Feb 28, 2017, at 6:38 PM, Sergey Beryozkin = >>>>>>> wrote: >>>>>>>=20 >>>>>>> Hi Freeman >>>>>>> On 27/02/17 23:44, Freeman Fang wrote: >>>>>>>> Hi Team, >>>>>>>>=20 >>>>>>>> We have websocket transport in CXF for a while, I wanna know = how >>>>>>>> wide is this used by CXF users, if this is widely used, is it >>>>>>>> feasible to also add undertow websocket implementation in CXF? >>>>>>>>=20 >>>>>>> The existing CXF web socket transport is meant to support JAX-RS >>>>>>> flows over WebSocket given that the JSR356 API is not = synchronized to >>>>>>> either JAX-RS or JAX-WS at all. Please check systests/jaxrs >>>>>>> WebSockets tests. >>>>>>> I do not remember Aki trying it with JAXWS but with a bit of the >>>>>>> extra work it will work with JAXWS too. >>>>>>> Aki started documenting it here: >>>>>>> http://cxf.apache.org/docs/websocket.html >>>>>>>=20 >>>>>>> and I recall we were discussing enhancing the transport for it = to >>>>>>> load the custom bindings to support SOAP etc >>>>>>>=20 >>>>>>> This transport uses Atmosphere if it is available and was tested = with >>>>>>> Tomcat 7 and Jetty, Tomcat 8 was problematic due to the issues = with >>>>>>> the way JSR356 implementation was picked up. Otherwise, if Jetty = is >>>>>>> available, it tries to use the Jetty implementation... This = transport >>>>>>> will work side by side with either the HTTP Servlet or Http = Jetty >>>>>>> transports. >>>>>>>=20 >>>>>>> Users are asking and trying it now and then not sure how widely = it is >>>>>>> used but it has to be supported IMHO and enhanced (custom = bindings. >>>>>>> etc). >>>>>>>=20 >>>>>>> As far as the Undertow WebSocket implementation is concerned, = why >>>>>>> would you like to get it into CXF ? >>>>>>>=20 >>>>>>> If it can support the JAXRS flows and possibly JAXWS flows the = way >>>>>>> the current transport can then why not, but IMHO this should be = a >>>>>>> prerequisite, given that CXF transports are here to support = JAXWS & >>>>>>> JAXRS. >>>>>>>=20 >>>>>>> The other question is, does Undertow implement JSR356 ? If yes = then >>>>>>> may be a better idea would be to fix the existing CXF websocket >>>>>>> transport to correctly load JSR356 code, which would make it = work >>>>>>> with the Undertow or Tomcat8 etc JSR356 code. >>>>>>>=20 >>>>>>> Thanks, Sergey >>>>>>>=20 >>>>>>>=20 >>>>>>>> Any input is appreciated. >>>>>>>>=20 >>>>>>>> Thanks! >>>>>>>> =EF=BC=8D=EF=BC=8D=EF=BC=8D=EF=BC=8D=EF=BC=8D=EF=BC=8D=EF=BC=8D=EF= =BC=8D=EF=BC=8D=EF=BC=8D=EF=BC=8D=EF=BC=8D=EF=BC=8D >>>>>>>> Freeman(Yue) Fang >>>>>>>>=20 >>>>>>>> Red Hat, Inc. >>>>>>>> FuseSource is now part of Red Hat >>>>>>>>=20 >>>>>>>>=20 >>>>>>>>=20 >>>>>>>>=20 >>>>>>>=20 >>>>>>=20 >>>>>>=20 >>>>>=20 >>>>=20 >>>>=20 >>>=20 >>>=20 >>> -- >>> Sergey Beryozkin >>>=20 >>> Talend Community Coders >>> http://coders.talend.com/ >>=20 >>=20 >=20 >=20 > --=20 > Sergey Beryozkin >=20 > Talend Community Coders > http://coders.talend.com/ --Apple-Mail=_1D3B789A-9102-4ADF-B468-3649FB3A9889--