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 D54B9200BB6 for ; Fri, 4 Nov 2016 10:06:42 +0100 (CET) Received: by cust-asf.ponee.io (Postfix) id D3FD0160AE9; Fri, 4 Nov 2016 09:06:42 +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 F3CD9160AE8 for ; Fri, 4 Nov 2016 10:06:41 +0100 (CET) Received: (qmail 7636 invoked by uid 500); 4 Nov 2016 09:06:41 -0000 Mailing-List: contact dev-help@camel.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@camel.apache.org Delivered-To: mailing list dev@camel.apache.org Received: (qmail 7624 invoked by uid 99); 4 Nov 2016 09:06:40 -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; Fri, 04 Nov 2016 09:06:40 +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 491A61A086F for ; Fri, 4 Nov 2016 09:06:40 +0000 (UTC) X-Virus-Scanned: Debian amavisd-new at spamd2-us-west.apache.org X-Spam-Flag: NO X-Spam-Score: 0.379 X-Spam-Level: X-Spam-Status: No, score=0.379 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, RCVD_IN_SORBS_SPAM=0.5, 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 QN-oq-YnPAAC for ; Fri, 4 Nov 2016 09:06:37 +0000 (UTC) Received: from mail-qk0-f178.google.com (mail-qk0-f178.google.com [209.85.220.178]) by mx1-lw-eu.apache.org (ASF Mail Server at mx1-lw-eu.apache.org) with ESMTPS id BED435FB1A for ; Fri, 4 Nov 2016 09:06:36 +0000 (UTC) Received: by mail-qk0-f178.google.com with SMTP id q130so89305889qke.1 for ; Fri, 04 Nov 2016 02:06:36 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:in-reply-to:references:from:date:message-id:subject:to; bh=a/96wy/z53dupKZNOBR02cXddUZd/3W4VaAqVF8PHiY=; b=GRVNJVxPD1DYrPuTPKHdfMDUFA3dDVegNj8iwSrGj8PHIhdg6KxBina1x6XshZcBjU GB4MwLUhm9TIzyhoi7Na9k8rVFtRiSIGaZoqkefgwfKiseH6KctUKkXcyt50+j1F+cz/ SxEexeMw0SlGOXqn9ey1+upKBouAaSU9awRqpdnA4wZYObpUe0Nj9M20X6uWuerodRsC ulo211vIEluCxJrbmQJk0bfWLAoIBUslKVdFQCipms8VM8nB5c7S+4KawGPZ6PN6YQq4 4f4SZtxyEcmkLevBk181tGup16SCm1oRgtGXE1js06NppxVaD4I2CAs0cZL0mFCpO8fd Lz4Q== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:in-reply-to:references:from:date :message-id:subject:to; bh=a/96wy/z53dupKZNOBR02cXddUZd/3W4VaAqVF8PHiY=; b=LcY7Ew1BYh/1f2MjC3tuem0UFijz3mMbp1za/DZBIUff2NlfmzP70rJCqBw0B2XVe9 Ff9Aa4gfawiDngx29wdQV8TC4mAxWYcZm578BHhFLwssqeWTfkdOeiuLx4gK/ItiT0dj Ho5UKrZ7UXiaMtDxDAjKwI2fklo3sDBqoMenLnsH9nOUnwIX3JqMDPnv+t8bbpE6+pgi Vbb9tZGCu1V1/bc5kfaxUjP9oKP1qxiL7/9WyfSOxiZVAMVsqJPss+QzZ0IbKr9nm51B j5/VKelTgrtDfEOoEvUTpGH1UrtpFTnKTtIGWh/kLXc5N5snpARC/u6LOp+LnOTw4QqU btLg== X-Gm-Message-State: ABUngvfPaQOrhnHWl6IdwYAMWpr1z54TUa+OBvQtLmFeHJAMhmkpu26KXOyXbJgPa+tZ4sUgMnuPr8l5PQ4GDw== X-Received: by 10.233.221.135 with SMTP id r129mr11569120qkf.204.1478250395641; Fri, 04 Nov 2016 02:06:35 -0700 (PDT) MIME-Version: 1.0 Received: by 10.237.62.141 with HTTP; Fri, 4 Nov 2016 02:06:15 -0700 (PDT) In-Reply-To: References: From: Claus Ibsen Date: Fri, 4 Nov 2016 10:06:15 +0100 Message-ID: Subject: Re: camel-properties enhancements To: dev Content-Type: text/plain; charset=UTF-8 archived-at: Fri, 04 Nov 2016 09:06:43 -0000 Sounds fine for inclusion in Camel 2.19 onwards. On Thu, Nov 3, 2016 at 1:30 PM, Luca Burgazzoli wrote: > Hi everyone, > > I've been working on a blueprint based applications for soem weeks and > I had to deal with a number of properties placeholders so I've used > camel-properties and I found some issues/limitation for which I've > raised the following JIRA: > > 1. CAMEL-10352: Optionally delegate to Aries PropertyEvaluator services > in BlueprintPropertiesParser > 2. CAMEL-10393: Add an option to disable using default value if a > property does not exists > 3. CAMEL-10417: Support adding location using child nodes of > propertyPlaceholder element > 4. CAMEL-10419: Allow to individually set whether to silently ignore a > missing location > > > CAMEL-10352 and CAMEL-10393 have already been merged and I've just > completed the implementation of CAMEL-10417 and CAMEL-10419 which you > can find in my fork: > > https://github.com/lburgazzoli/apache-camel/tree/camel-properties > > > Before merge it I'd like to have your opinion as there are some small > changes about the XML configuration I'm going to highlight here: > > 1. As today, you can customize the property placeholders with the tag > propertyPlaceholder where the attribute location is mandatory and > that is fine untill you just want to register your own function in > blueprint which lead to something like that: > > id="myPropertyPlaceholder" > location="none" > ignoreMissingLocation="true"> > > > > > > So you may think that you have no locations set but that is not true > because by default camel-blueprint detects OSGi blueprint property > placeholders services and add them to the mix. Of course you can > disable such behavior but I found this a little bit confusing so I > made it not more mandatory (in fact that is the same behavior you'd > have if you define a PropertiesComponent bean instead of using the > propertyPlaceholder tag) and now you can now write it as: > > > > > > 2. As today to add new properties placeholder locations you need to set > them with the location attribute using comma as separator and this > work just fine but it may result confusing if you need to deal with a > number of properties files. In addition you can't set which location > is required and which may be missing as the option to ignore missing > location is global so I've enhanced the propertyPlaceholder tag in a > way you can add locations as: > > > > resolver = "classpath" > path = "com/my/company/something/my-properties-1.properties" > optional = "false"/> > > resolver = "classpath" > path = "com/my/company/something/my-properties-2.properties" > optional = "false"/> > > resolver = "file" > path = "${karaf.home}/etc/my-override.properties" > optional = "true"/> > > > > Note that the attribute resolver and optional are not mandatory and > have classpath and false as default value respectivley. > > Of course setting locations via location attribute is still supported > and it has been enhanced to support additional attributes, i.e.: > > id="myPropertyPlaceholder" > location="file:${karaf.home}/etc/my.properties;optional=true"/> > > Note that the locations defined by the propertiesLocation tag are > added to those defined in location attribute. > > > Any objection/suggestion on such implementation ? > > > Regards, > Luca > > --- > Luca Burgazzoli -- Claus Ibsen ----------------- http://davsclaus.com @davsclaus Camel in Action 2: https://www.manning.com/ibsen2