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 CC2BA200CD2 for ; Thu, 27 Jul 2017 22:51:06 +0200 (CEST) Received: by cust-asf.ponee.io (Postfix) id CA72916B978; Thu, 27 Jul 2017 20:51:06 +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 2980116B971 for ; Thu, 27 Jul 2017 22:51:06 +0200 (CEST) Received: (qmail 14832 invoked by uid 500); 27 Jul 2017 20:51:05 -0000 Mailing-List: contact jira-help@kafka.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: jira@kafka.apache.org Delivered-To: mailing list jira@kafka.apache.org Received: (qmail 14809 invoked by uid 99); 27 Jul 2017 20:51:05 -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; Thu, 27 Jul 2017 20:51:05 +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 B8ABFC04A0 for ; Thu, 27 Jul 2017 20:51:04 +0000 (UTC) X-Virus-Scanned: Debian amavisd-new at spamd4-us-west.apache.org X-Spam-Flag: NO X-Spam-Score: -100.002 X-Spam-Level: X-Spam-Status: No, score=-100.002 tagged_above=-999 required=6.31 tests=[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 1to9MgZrbelu for ; Thu, 27 Jul 2017 20:51:03 +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 7A85A61B58 for ; Thu, 27 Jul 2017 20:51:03 +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 494B7E0E3F for ; Thu, 27 Jul 2017 20:51:02 +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 520FC24DBE for ; Thu, 27 Jul 2017 20:51:01 +0000 (UTC) Date: Thu, 27 Jul 2017 20:51:01 +0000 (UTC) From: =?utf-8?Q?S=C3=B6nke_Liebau_=28JIRA=29?= To: jira@kafka.apache.org Message-ID: In-Reply-To: References: Subject: [jira] [Assigned] (KAFKA-5563) Clarify handling of connector name in config MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-JIRA-FingerPrint: 30527f35849b9dde25b450d4833f0394 archived-at: Thu, 27 Jul 2017 20:51:07 -0000 [ https://issues.apache.org/jira/browse/KAFKA-5563?page=3Dcom.atlassia= n.jira.plugin.system.issuetabpanels:all-tabpanel ] S=C3=B6nke Liebau reassigned KAFKA-5563: ----------------------------------- Assignee: S=C3=B6nke Liebau > Clarify handling of connector name in config=20 > --------------------------------------------- > > Key: KAFKA-5563 > URL: https://issues.apache.org/jira/browse/KAFKA-5563 > Project: Kafka > Issue Type: Bug > Components: KafkaConnect > Affects Versions: 0.11.0.0 > Reporter: S=C3=B6nke Liebau > Assignee: S=C3=B6nke Liebau > Priority: Minor > > The connector name is currently being stored in two places, once at the r= oot level of the connector and once in the config: > {code:java} > { > =09"name": "test", > =09"config": { > =09=09"connector.class": "org.apache.kafka.connect.tools.MockSinkConnecto= r", > =09=09"tasks.max": "3", > =09=09"topics": "test-topic", > =09=09"name": "test" > =09}, > =09"tasks": [ > =09=09{ > =09=09=09"connector": "test", > =09=09=09"task": 0 > =09=09} > =09] > } > {code} > If no name is provided in the "config" element, then the name from the ro= ot level is [copied there when the connector is being created|https://githu= b.com/apache/kafka/blob/trunk/connect/runtime/src/main/java/org/apache/kafk= a/connect/runtime/rest/resources/ConnectorsResource.java#L95]. If however a= name is provided in the config then it is not touched, which means it is p= ossible to create a connector with a different name at the root level and i= n the config like this: > {code:java} > { > =09"name": "test1", > =09"config": { > =09=09"connector.class": "org.apache.kafka.connect.tools.MockSinkConnecto= r", > =09=09"tasks.max": "3", > =09=09"topics": "test-topic", > =09=09"name": "differentname" > =09}, > =09"tasks": [ > =09=09{ > =09=09=09"connector": "test1", > =09=09=09"task": 0 > =09=09} > =09] > } > {code} > I am not aware of any issues that this currently causes, but it is at lea= st confusing and probably not intended behavior and definitely bears potent= ial for bugs, if different functions take the name from different places. > Would it make sense to add a check to reject requests that provide differ= ent names in the request and the config section? -- This message was sent by Atlassian JIRA (v6.4.14#64029)