Return-Path: X-Original-To: apmail-camel-users-archive@www.apache.org Delivered-To: apmail-camel-users-archive@www.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id D50F918D76 for ; Thu, 10 Mar 2016 09:16:09 +0000 (UTC) Received: (qmail 75132 invoked by uid 500); 10 Mar 2016 09:16:09 -0000 Delivered-To: apmail-camel-users-archive@camel.apache.org Received: (qmail 75080 invoked by uid 500); 10 Mar 2016 09:16:09 -0000 Mailing-List: contact users-help@camel.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: users@camel.apache.org Delivered-To: mailing list users@camel.apache.org Received: (qmail 75067 invoked by uid 99); 10 Mar 2016 09:16:09 -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; Thu, 10 Mar 2016 09:16:08 +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 9010BC0088 for ; Thu, 10 Mar 2016 09:16:08 +0000 (UTC) X-Virus-Scanned: Debian amavisd-new at spamd1-us-west.apache.org X-Spam-Flag: NO X-Spam-Score: 0.843 X-Spam-Level: X-Spam-Status: No, score=0.843 tagged_above=-999 required=6.31 tests=[DKIM_SIGNED=0.1, DKIM_VALID=-0.1, FREEMAIL_ENVFROM_END_DIGIT=0.25, HEADER_FROM_DIFFERENT_DOMAINS=0.001, RCVD_IN_DNSWL_LOW=-0.7, RCVD_IN_MSPIKE_H3=-0.01, RCVD_IN_MSPIKE_WL=-0.01, SPF_PASS=-0.001, URI_HEX=1.313] autolearn=disabled Authentication-Results: spamd1-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 (spamd1-us-west.apache.org [10.40.0.7]) (amavisd-new, port 10024) with ESMTP id eWde0wYskfsH for ; Thu, 10 Mar 2016 09:16:04 +0000 (UTC) Received: from mail-wm0-f47.google.com (mail-wm0-f47.google.com [74.125.82.47]) by mx1-lw-eu.apache.org (ASF Mail Server at mx1-lw-eu.apache.org) with ESMTPS id 51E4C5F56B for ; Thu, 10 Mar 2016 09:16:04 +0000 (UTC) Received: by mail-wm0-f47.google.com with SMTP id l68so19606769wml.1 for ; Thu, 10 Mar 2016 01:16:04 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=sender:subject:to:references:from:message-id:date:user-agent :mime-version:in-reply-to:content-transfer-encoding; bh=aK3ayrv03cDigOcN6BQbnpiTd1o9NPFPbH9TvK+Ghqo=; b=f/DFojbBBC1hdC+cfMELl0Ij5C9F7D1+ucUuhnSB4EfVBv5hu1bvJQQmXtsG1NST2x BdJ0R2cCkKlHDloaY/+UQb+kjlIjDASo466GSbjtWuZzec0GBC1y1eJXIQQFo+neEw4P QzG3U+uvrte86vb1XkJIk4fb4o8UwAeSzyGhRPQo/GoEunJ6nj6zq+VARAAgPHinN4dg x6RAWGTs7cF9fGlS9w1JVFkekC7tleAsZUWEXHytNyphpmMdAn+bZBBsJCqwkg29v9Sz ehxYqtTVw3o12MPRl+g4lKhExD9ficlMW6nk3GrK9qiJchBBnwSGnFz05fBsxvPzZsG0 46wg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:sender:subject:to:references:from:message-id :date:user-agent:mime-version:in-reply-to:content-transfer-encoding; bh=aK3ayrv03cDigOcN6BQbnpiTd1o9NPFPbH9TvK+Ghqo=; b=Y3u0knUE3LUzEsZa9gv6GGs5IsTRaqdheG7sdTwcw5WKR4CMWmpXaKR5oBAlqBR09O YUR4BxeCuSmB6xMP7nFbqWVmFjk+YmPPI00x6BgtW+RZHuTK7HD5u6fZnKiULOYY00MK thoJ2wnwlGQhTesCfzPD7gRcPahAqYp8N/ofBsd6UqIDSq/59udHJ9dtJrIh68rD+xiu UuwTPIi9qcTF2ttk+c0D3ivArEjeO/y3FkOwYHaZ+jJ5buoU9sfIpmfFmWyFeMogO2WE ofx2l0fVb6dW0XBNeHrW4EqWssVZsGp+Hsw00sLunqCuS19vSuqMMmuZNX9aFYMy/cvM g0mA== X-Gm-Message-State: AD7BkJLaOpcxE9EPW2d4G7mCS0v8vHYkuMMw2LIhNAKszzt0d/8mGIWoi6hp4GlkJzbLbw== X-Received: by 10.194.192.36 with SMTP id hd4mr2365741wjc.85.1457601364000; Thu, 10 Mar 2016 01:16:04 -0800 (PST) Received: from [192.168.0.108] (HSI-KBW-149-172-61-90.hsi13.kabel-badenwuerttemberg.de. [149.172.61.90]) by smtp.googlemail.com with ESMTPSA id i1sm2466667wjs.45.2016.03.10.01.16.02 for (version=TLSv1/SSLv3 cipher=OTHER); Thu, 10 Mar 2016 01:16:03 -0800 (PST) Sender: Christian Schneider Subject: Re: CXF cross cutting concerns To: users@camel.apache.org References: <1457537164834-5778798.post@n5.nabble.com> From: Christian Schneider Message-ID: <56E13B52.6080100@die-schneider.net> Date: Thu, 10 Mar 2016 10:16:02 +0100 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:38.0) Gecko/20100101 Thunderbird/38.6.0 MIME-Version: 1.0 In-Reply-To: <1457537164834-5778798.post@n5.nabble.com> Content-Type: text/plain; charset=windows-1252; format=flowed Content-Transfer-Encoding: 7bit I have searched for a solution to the problem you described for a long time now and finally found a good concept. Cross cutting concerns can be solved using the TopologyManager in the Remote Service Admin spec (CXF-DOSGi). One duty of the TopologyManager is to watch all registered OSGi services and then eventually trigger RemoteServiceAdmin to export such services. See this tutorial for a simple example: http://liquid-reality.de/display/liquid/2013/02/13/Apache+Karaf+Tutorial+Part+8+-+Distributed+OSGi The service in the DS example leverages DOSGi to export a REST service: https://github.com/cschneider/Karaf-Tutorial/blob/master/tasklist-ds/service/src/main/java/net/lr/tasklist/service/TaskServiceRest.java By default the TopologyManager only watches for services with the property osgi.remote.interfaces but according to the spec it can react on any service it wants. It also can add arbitary configuration to the OSGi service properties. One of these properties are the intents a service must support. For CXF this translates to CXF features. So this can be used to add cross cutting concerns like security, logging to any service. The CXF provider for RemoteServiceAdmin can then export and import the OSGi services as REST and SOAP services depending on their annotations. Unfortunately we are not yet there. The current TopologyManager impl does not support adding cross cutting concerns but the spec fully supports that so we can develop such support in the future. Christian On 09.03.2016 16:26, Ranx wrote: > I have a client who wants to use deployable microservice bundles with > REST/SOAP APIs. Not a problem of course as it works very well. > > The issue is that I'm getting a lot of boilerplate replication across the > project which is only getting to get bigger and more difficult to manage > with time. > > This includes everything from basic host/port settings to security. > Obviously setting that up in every bundles is error prone (especially with > XML) and the a real headache for maintenance. Part of the problem is that > from what I've read sharing cfg files across bundles is not recommended. > Perhaps with an update strategy reload that isn't such a big deal. But it > would be nice to have something like: > > com.foo.basic.rest.cfg > com.foo.basic.soap.cfg > > and use that in each of my bundles to load basic configuration information. > Each bundle would still have its own cfg file that will be used for very > special and custom items. > > Things like PasswordCallback and keystores are exactly the same. In the > past I've always used a gateway bundle to centralize that. I may still end > up using something like that in this project but as "microservices" become > more and more the holy grail (until it isn't anymore) this is going to be an > on-going concern. > > I'm using Karaf so can also imagine using OSGi registry for creating CXF > interceptors that I might inject into the setup of each of my projects. > > This problem is manifesting on the endpoints in both directions. For > example, one of the systems I'm integrating with is JDEdwards SOAP services > which require PasswordCallbacks and http conduit settings. But there are a > large number of these services with WSDLs for many aspects of inventory, > supply, invoices, etc. > > > > > > > -- > View this message in context: http://camel.465427.n5.nabble.com/CXF-cross-cutting-concerns-tp5778798.html > Sent from the Camel - Users mailing list archive at Nabble.com. -- Christian Schneider http://www.liquid-reality.de Open Source Architect http://www.talend.com