From dev-return-18914-archive-asf-public=cust-asf.ponee.io@cxf.apache.org Sun Feb 25 17:38:27 2018 Return-Path: X-Original-To: archive-asf-public@cust-asf.ponee.io Delivered-To: archive-asf-public@cust-asf.ponee.io Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by mx-eu-01.ponee.io (Postfix) with SMTP id F0CCE18064C for ; Sun, 25 Feb 2018 17:38:26 +0100 (CET) Received: (qmail 87334 invoked by uid 500); 25 Feb 2018 16:38:25 -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 87318 invoked by uid 99); 25 Feb 2018 16:38:25 -0000 Received: from pnap-us-west-generic-nat.apache.org (HELO spamd2-us-west.apache.org) (209.188.14.142) by apache.org (qpsmtpd/0.29) with ESMTP; Sun, 25 Feb 2018 16:38:25 +0000 Received: from localhost (localhost [127.0.0.1]) by spamd2-us-west.apache.org (ASF Mail Server at spamd2-us-west.apache.org) with ESMTP id C0B8D1A00F1 for ; Sun, 25 Feb 2018 16:38:24 +0000 (UTC) X-Virus-Scanned: Debian amavisd-new at spamd2-us-west.apache.org X-Spam-Flag: NO X-Spam-Score: -0.121 X-Spam-Level: X-Spam-Status: No, score=-0.121 tagged_above=-999 required=6.31 tests=[DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, RCVD_IN_MSPIKE_H3=-0.01, RCVD_IN_MSPIKE_WL=-0.01, SPF_PASS=-0.001] autolearn=disabled Authentication-Results: spamd2-us-west.apache.org (amavisd-new); dkim=pass (2048-bit key) header.d=gmail.com Received: from mx1-lw-eu.apache.org ([10.40.0.8]) by localhost (spamd2-us-west.apache.org [10.40.0.9]) (amavisd-new, port 10024) with ESMTP id Mwa5oEAVL8CN for ; Sun, 25 Feb 2018 16:38:22 +0000 (UTC) Received: from mail-qk0-f196.google.com (mail-qk0-f196.google.com [209.85.220.196]) by mx1-lw-eu.apache.org (ASF Mail Server at mx1-lw-eu.apache.org) with ESMTPS id 9DBFC5F4AE for ; Sun, 25 Feb 2018 16:38:21 +0000 (UTC) Received: by mail-qk0-f196.google.com with SMTP id o25so10884808qkl.7 for ; Sun, 25 Feb 2018 08:38:21 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=date:from:reply-to:message-id:to:cc:subject:in-reply-to:references :mime-version:content-transfer-encoding; bh=FYuaFxu8tWhj9MGcIaCyCW5QNHWcRCKOIgXng4n5Kas=; b=NzMDSlVoWw2hyDFvTbFzPekUntf4EiwfD4raPUQw5ZroWpLOZ0AoVXvEnH0sMnD/R1 LVY6CNEcz9rDMcW6Xp64UU5DD4e1ppkXBZdQ/1J5hOrduSbfjND0tfnHOw8MI66A2RSs JUOzlLpaoIi6q69SVIdJmBWWmhr47JfbEIjII4/1sRdjaEJORk+ONQQcHXbMEmcA87Pn y6u++HYp89EUNwVxNSJqdxj13ul0UtR5l7sxsvXLlOPRRt4tyyzB4pR/VvkwmShUj+29 I5Msp53bKVqxjyQ0Mc39YQ+3jSqJ6aTKgbDgKpn6wBqqcTudmsVCx6yKJGZm+Y8fdnQq ugCg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:reply-to:message-id:to:cc:subject :in-reply-to:references:mime-version:content-transfer-encoding; bh=FYuaFxu8tWhj9MGcIaCyCW5QNHWcRCKOIgXng4n5Kas=; b=sPCV/CQey/cQxRenzLai//Mdy30jQD9+gEqOq42n9yO+XRV3r194EgoFs4SZOGRKGU itljlTIor9kJ3oaoeF7nu5kJyXiZs3IBDHlppk3+gPJvZ3exsNbsIiuFynI0yIYKaZz7 fNStwY5E6fxwwrCzWbD4jO1RhaS8gSUe/iVsT6EjJg2w15dZ8HavBbemv3sluVsvv9k3 Z4BadwlVPFbJGdS2gI2BC5IxIV8A3EUCf5AKErYVHKFE6MKzZsjMgdUFZpkUoiXGUMtl gZH8cOyUycS+DjMaAgdAvdhQIcQ6AIOgIr9IksPjDOnvUyrp4a/sd/uCN7I3THVXA1y9 tidg== X-Gm-Message-State: APf1xPDxV9Y2GHjtn9VcL9+Pkpugaie+KtbwFjrEk+zjGc83MrPhTZ1f 0IwzoAcOfMskQuT9/sJdDy4= X-Google-Smtp-Source: AG47ELtt1mKqbwe2gd+qy+lpol3hPU6ASNeN/sa/JGlXHk02yY9pphIBX8ZQ1aTdPGWWzbcXxvQZeg== X-Received: by 10.55.156.75 with SMTP id f72mr13115938qke.235.1519576700391; Sun, 25 Feb 2018 08:38:20 -0800 (PST) Received: from [192.168.0.103] ([166.62.251.82]) by smtp.gmail.com with ESMTPSA id 58sm4146697qtm.51.2018.02.25.08.38.19 (version=TLS1_1 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Sun, 25 Feb 2018 08:38:19 -0800 (PST) Date: Sun, 25 Feb 2018 11:38:17 -0500 From: Andriy Redko Reply-To: Andriy Redko Message-ID: <1911375142.20180225113817@gmail.com> To: "John D. Ament" CC: dev@cxf.apache.org Subject: Re: Handling the case where CXF Servlet doesn't match expected transport ID In-Reply-To: References: <188967612.20180225092456@gmail.com> <754986152.20180225104426@gmail.com> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit Sounds reasonable, would you mind to create a ticket? I could pick it up shortly (or if you have time, please go ahead). Thanks. JDA> Actually here's another way. JDA> Create a new property on bus for the default transport ID JDA> Default it to the HTTP one JDA> in the SSE extension, override it to SSE. JDA> On Sun, Feb 25, 2018 at 10:47 AM John D. Ament wrote: JDA> Basically, yes. JDA> So here's what I'm thinking. JDA> - Determine that transportId is null JDA> - ask for the registered HTTP one ending with /configuration JDA> - If that's null, loop through all registered and return the first one ending with /configuration JDA> Thoughts? JDA> On Sun, Feb 25, 2018 at 10:44 AM Andriy Redko wrote: JDA> Hey John, JDA> You mean add the capability to DestinationFactoryManager to list all registered JDA> destination factories and in case transport id is not set, just pick the first JDA> one? We could try it out, may be we could also give a preference to HTTP transport JDA> in case more than one is available (at least to minimize the effect of the change). JDA> Also, the documentation should be updated to reflect the SSE transport presence, I JDA> will do that shortly. Thanks for spotting it. JDA> Makes sense? JDA> Best Regards, JDA> Andriy Redko JDA>> Andriy, JDA>> Sadly no. Honestly, this leads to broken apps. Just to clarify my setup: JDA>> - WAR File deployed to Tomcat JDA>> - Has Weld Servlet + CXF CDI + CXF SSE modules deployed JDA>> - Has no SSE server side components JDA>> At this point, I may use the client to talk to a remote server (for JDA>> inter-node communication) but don't rely on it long term. I have no server JDA>> side components. But you're saying I must set the transportId to SSE. JDA>> The SSE transportId requirement is not documented anywhere as best as I can JDA>> tell. SSE isn't listed at http://cxf.apache.org/docs/transports.html for JDA>> Atmosphere. JDA>> I think a better approach would be to modify JDA>> CXFNonSpringServlet.getDestinationRegistryFromBusOrDefault ( JDA>> https://github.com/apache/cxf/blob/master/rt/transports/http/src/main/java/org/apache/cxf/transport/servlet/CXFNonSpringServlet.java#L119 JDA>> ) JDA>> so that instead of hard coding the HTTP transport as the default, we ask JDA>> for the first destination factory it finds registered (if one is). JDA>> Thoughts? JDA>> John JDA>> On Sun, Feb 25, 2018 at 9:25 AM Andriy Redko wrote: >>> I wish it could be as easy as that :) Hope my previous messages give some >>> context and explanations why we have dedicated transport and why we need >>> to set Transport Id in a few places, not just one. It would be ideal to >>> enrich HTTP transport with SSE support but it will take some time, not >>> an easy one (certainly doable). >>> Best Regards, >>> Andriy Redko >>> JDA> I see a bit more when this is failing. >>> JDA> When the JAXRS bean has the transport ID set, In >>> DestinationFactoryManager >>> JDA> you have two factories created, both for SSE (regular & config >>> JDA> namespaces). However, since on the servlet the transportId is null >>> when it >>> JDA> tries to look up the namespace it defaults to the HTTP transport. >>> This >>> JDA> causes it to create a new destination factory where nothing has been >>> found. >>> JDA> So I think what I would recommend is coming up with a way for CXF to >>> figure >>> JDA> out a better default, instead of the using the default transportId. >>> JDA> Or do as Romain says and make it so that SSE works on the normal >>> JDA> transportId. >>> JDA> John >>> JDA> On Sun, Feb 25, 2018 at 3:05 AM Romain Manni-Bucau < >>> rmannibucau@gmail.com> >>> JDA> wrote: >>> >> +1 wondered the same and technically sse can just be activated for http >>> >> transport IMHO >>> >> Le 25 févr. 2018 05:10, "John D. Ament" a >>> écrit : >>> >> > Here's a reproducer app, if anyone else is curious. >>> >> > https://github.com/johnament/cxf-demo-reactive-cdi >>> >> > >>> >> > If you comment out >>> >> > https://github.com/johnament/cxf-demo-reactive-cdi/blob/ >>> >> > master/src/main/webapp/WEB-INF/web.xml#L10-L13 >>> >> > then >>> >> > you'll see the issue, but deploying this as is to tomcat will work >>> just >>> >> > fine. >>> >> > >>> >> > On Sat, Feb 24, 2018 at 10:59 PM John D. Ament >> > >>> >> > wrote: >>> >> > >>> >> > > Hi, >>> >> > > >>> >> > > So I've finally been able to confirm an issue. >>> >> > > >>> >> > > When CXF's SSE libraries are on the classpath, if the transportId of >>> >> the >>> >> > > servlet does not match the transport ID set with the SSE component, >>> >> then >>> >> > no >>> >> > > services are discovered. >>> >> > > >>> >> > > IMHO, there may be cases where the SSE libraries are present (client >>> >> > only) >>> >> > > and no server runtimes are there. In this case, the transport ID >>> will >>> >> > not >>> >> > > match. >>> >> > > >>> >> > > I'm curious, do both need to be set? What is the benefit/need on >>> the >>> >> > > servlet layer needing the transport ID set when the underlying >>> feature >>> >> > also >>> >> > > does it? >>> >> > > >>> >> > > John >>> >> > > >>> >> >