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 6C42B18731 for ; Tue, 15 Mar 2016 12:48:34 +0000 (UTC) Received: (qmail 62941 invoked by uid 500); 15 Mar 2016 12:48:33 -0000 Delivered-To: apmail-camel-users-archive@camel.apache.org Received: (qmail 62804 invoked by uid 500); 15 Mar 2016 12:48:33 -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 62235 invoked by uid 99); 15 Mar 2016 12:48:28 -0000 Received: from pnap-us-west-generic-nat.apache.org (HELO spamd3-us-west.apache.org) (209.188.14.142) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 15 Mar 2016 12:48:28 +0000 Received: from localhost (localhost [127.0.0.1]) by spamd3-us-west.apache.org (ASF Mail Server at spamd3-us-west.apache.org) with ESMTP id CFEAD18027E for ; Tue, 15 Mar 2016 12:48:27 +0000 (UTC) X-Virus-Scanned: Debian amavisd-new at spamd3-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: spamd3-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 (spamd3-us-west.apache.org [10.40.0.10]) (amavisd-new, port 10024) with ESMTP id ntnMaiQ51C0E for ; Tue, 15 Mar 2016 12:48:25 +0000 (UTC) Received: from mail-wm0-f43.google.com (mail-wm0-f43.google.com [74.125.82.43]) by mx1-lw-us.apache.org (ASF Mail Server at mx1-lw-us.apache.org) with ESMTPS id 5ECC55F620 for ; Tue, 15 Mar 2016 12:48:25 +0000 (UTC) Received: by mail-wm0-f43.google.com with SMTP id p65so142974581wmp.1 for ; Tue, 15 Mar 2016 05:48:25 -0700 (PDT) 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=klgG24SeDpcKMAVhKvlHUP4vSYfwqHixE5cly+35t4A=; b=IQh5pVw+J2ZbP6BbeooayFXITsxBujqDYaF7WF+oNufi4kkTMaTHJtW+hxag1pmo64 qhWn2QFNpHsDv6v0B42JY8lJZCWxkmWCGAMytxfkpMUD8m1pxvR13vBKb0WxTtr6O15m yHaSXQgipUOcjpcDPOKxz0ZvcoaHcdamI4mkOLXL2ox0e03CYyM6boFHg2MbJuz2CoMc 3DIT4rp0g4maSqqy9Y4mak0hdf9qv3o4rdA4PZuG+rd3NciYvtF5+/0bKPFo9ckS4ibT xN+BPo2vQv+uLLoLSqmxDf7JfPQNErXpX7vK+hZ9GwfV6GAdWOEgeRUCH7CGWntV7qSX cuNA== 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=klgG24SeDpcKMAVhKvlHUP4vSYfwqHixE5cly+35t4A=; b=CEelBnU8alm2pE3EuZdIjilE/FHmmRDoyMo1ZYCACqdcWIm2o3k91bOS/nSQDJbVey ldQ6Ojg6SFYRuluTSNtC5reiE5HfqPcTzxSuQgT3WNSHskji2bW064HUwTz+rhhA/hQi 83jhZ9hA9zk7eFqNv7qHK26H4PhvrfU226ohkZHihyFLw2LO/+s1OfMkTh1HmhHFltNn dElVV9guKsWxC8HW4y5xEdr3ZqWlRSNNMzUfqx2R/Fj3QxQHQafVSNDFnHQol9THT6UV HNz6x5m4iqys5TnR3j9wI7t5dMzjq2UZGA3WuoadY3nmm0dffKMMQ9wxj4gB73mD+qpm SaTg== X-Gm-Message-State: AD7BkJL+raaXOoERR0NMMsFFmVbvKD3cnezi7ouF1ecfdN3HxQYew63rUUS5oMPa0fN+Kw== X-Received: by 10.194.205.138 with SMTP id lg10mr29892409wjc.153.1458046104203; Tue, 15 Mar 2016 05:48:24 -0700 (PDT) Received: from [172.20.0.187] (b2b-92-50-84-158.unitymedia.biz. [92.50.84.158]) by smtp.googlemail.com with ESMTPSA id t7sm26929159wjf.39.2016.03.15.05.48.22 for (version=TLSv1/SSLv3 cipher=OTHER); Tue, 15 Mar 2016 05:48:23 -0700 (PDT) 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: <56E80496.8020407@die-schneider.net> Date: Tue, 15 Mar 2016 13:48:22 +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: Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 8bit Changing the already posted busses is not such a good idea. The CXF DOSGi way is to use intents. You can publish a feature as a service and give it a property org.apache.cxf.dosgi.IntentName=myname. In the OSGi service to be exported you can then set the property service.exported.intents to a list of intent names that must be supported to export this service. CXF DOSGi will then make sure it finds suitable intent services and will apply them as features before exporting your service. Christian On 14.03.2016 21:52, Raul Kripalani wrote: > Hi > > I blogged about this a long while ago. CXF registers all buses as OSGi > services, so you can create a service listener that watches them come and > go, reacting accordingly. You do get a reference to the bus, so you can add > interceptors, features or change whatever configuration you'd like to by > finding your way around the API. > > Have a look at > http://raul.io/enriching-services-with-cxf-interceptors-in-osgi/, and let > me know if it helped. > > Cheers, > Raúl. > On 9 Mar 2016 15: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