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 A42F3200C7E for ; Tue, 9 May 2017 07:40:10 +0200 (CEST) Received: by cust-asf.ponee.io (Postfix) id A2C0F160BCA; Tue, 9 May 2017 05:40:10 +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 F275F160BA5 for ; Tue, 9 May 2017 07:40:09 +0200 (CEST) Received: (qmail 57229 invoked by uid 500); 9 May 2017 05:40:08 -0000 Mailing-List: contact issues-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 issues@camel.apache.org Received: (qmail 57204 invoked by uid 99); 9 May 2017 05:40:08 -0000 Received: from pnap-us-west-generic-nat.apache.org (HELO spamd4-us-west.apache.org) (209.188.14.142) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 09 May 2017 05:40:08 +0000 Received: from localhost (localhost [127.0.0.1]) by spamd4-us-west.apache.org (ASF Mail Server at spamd4-us-west.apache.org) with ESMTP id 2184DC00B6 for ; Tue, 9 May 2017 05:40:08 +0000 (UTC) X-Virus-Scanned: Debian amavisd-new at spamd4-us-west.apache.org X-Spam-Flag: NO X-Spam-Score: -99.202 X-Spam-Level: X-Spam-Status: No, score=-99.202 tagged_above=-999 required=6.31 tests=[KAM_ASCII_DIVIDERS=0.8, RP_MATCHES_RCVD=-0.001, SPF_PASS=-0.001, USER_IN_WHITELIST=-100] autolearn=disabled Received: from mx1-lw-eu.apache.org ([10.40.0.8]) by localhost (spamd4-us-west.apache.org [10.40.0.11]) (amavisd-new, port 10024) with ESMTP id gyr_EvowxYbB for ; Tue, 9 May 2017 05:40:06 +0000 (UTC) Received: from mailrelay1-us-west.apache.org (mailrelay1-us-west.apache.org [209.188.14.139]) by mx1-lw-eu.apache.org (ASF Mail Server at mx1-lw-eu.apache.org) with ESMTP id 5097F5FCE8 for ; Tue, 9 May 2017 05:40:05 +0000 (UTC) Received: from jira-lw-us.apache.org (unknown [207.244.88.139]) by mailrelay1-us-west.apache.org (ASF Mail Server at mailrelay1-us-west.apache.org) with ESMTP id 8012AE07D6 for ; Tue, 9 May 2017 05:40:04 +0000 (UTC) Received: from jira-lw-us.apache.org (localhost [127.0.0.1]) by jira-lw-us.apache.org (ASF Mail Server at jira-lw-us.apache.org) with ESMTP id 363C221DF7 for ; Tue, 9 May 2017 05:40:04 +0000 (UTC) Date: Tue, 9 May 2017 05:40:04 +0000 (UTC) From: "Luca Burgazzoli (JIRA)" To: issues@camel.apache.org Message-ID: In-Reply-To: References: Subject: [jira] [Comment Edited] (CAMEL-10031) camel-spring-boot - Add endpoint options as type-safe configuration properties MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-JIRA-FingerPrint: 30527f35849b9dde25b450d4833f0394 archived-at: Tue, 09 May 2017 05:40:10 -0000 [ https://issues.apache.org/jira/browse/CAMEL-10031?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16001029#comment-16001029 ] Luca Burgazzoli edited comment on CAMEL-10031 at 5/9/17 5:39 AM: ----------------------------------------------------------------- Would it make sense to have an hook on the component to inject an "endpoint options processor" ? Because not all the endpoints have a getter/setter for the options (most of the new component have a configuration class instead) the auto configuration task may not be trivial. As far as I remember there was also a discussion on how to assign an id to an endpoint and if we can make that we can do something like: {code:java} from("ftp://bar@myserver/path?id=test") .to("...") {code} {code:java} // Use the dot notation for maps as the [] may not work // in some properties back-end (i.e. k8s' configmaps/secrets) camel.component.ftp.endpoints.test..password = secret {code} The hook (which is added by spring-boot auto configuration) will then inspect the components option for an id field and adds the options from spring-boot related to such id. For xml we can leverage the id on the element. The hook may be triggered between: {code:java} Endpoint createEndpoint(String uri) {code} And: {code:java} Endpoint createEndpoint(String uri, String remaining, Map parameters) {code} An interesting side effect of this implementation is that secrets like username and password may be provided by the vault back-end or i.e. kubernetes secrets for application that have spring-cloud-kubernetes without requiring to create the endpoints outside the route. was (Author: lb): Would it make sense to have an hook on the component to inject an "endpoint options processor" ? Because not all the endpoints have a getter/setter for the options (most of the new component have a configuration class instead) the auto configuration task may not be trivial. As far as I remember there was also a discussion on how to assign an id to an endpoint and if we can make that we can do something like: {code:java} from("ftp://bar@myserver/path?id=test") .to("...") {code} {code} # Use the dot notation for maps as the [] may not work # in some properties back-end (i.e. k8s' configmaps/secrets) camel.component.ftp.endpoints.test..password = secret {code} The hook (which is added by spring-boot auto configuration) will then inspect the components option for an id field and adds the options from spring-boot related to such id. For xml we can leverage the id on the element. The hook may be triggered between: {code:java} Endpoint createEndpoint(String uri) {code} And: {code:java} Endpoint createEndpoint(String uri, String remaining, Map parameters) {code} An interesting side effect of this implementation is that secrets like username and password may be provided by the vault back-end or i.e. kubernetes secrets for application that have spring-cloud-kubernetes without requiring to create the endpoints outside the route. > camel-spring-boot - Add endpoint options as type-safe configuration properties > ------------------------------------------------------------------------------ > > Key: CAMEL-10031 > URL: https://issues.apache.org/jira/browse/CAMEL-10031 > Project: Camel > Issue Type: New Feature > Components: camel-spring-boot > Reporter: Claus Ibsen > Assignee: Nicola Ferraro > > See CAMEL-9419. > We can now configure this for all the components. But for endpoints its a bit more as you can have many endpoints with different configuration. > So either you assign an id to the endpoint you configure, and then need to refer to the endpoint by id, in the camel routes. Or we figure out something else. -- This message was sent by Atlassian JIRA (v6.3.15#6346)