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 BC555200BFA for ; Thu, 12 Jan 2017 21:54:10 +0100 (CET) Received: by cust-asf.ponee.io (Postfix) id BAF1B160B40; Thu, 12 Jan 2017 20:54: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 DCD16160B29 for ; Thu, 12 Jan 2017 21:54:09 +0100 (CET) Received: (qmail 29932 invoked by uid 500); 12 Jan 2017 20:54:04 -0000 Mailing-List: contact user-help@flink.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: user@flink.apache.org Delivered-To: mailing list user@flink.apache.org Received: (qmail 29922 invoked by uid 99); 12 Jan 2017 20:54:03 -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; Thu, 12 Jan 2017 20:54:03 +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 8ADB71A0490 for ; Thu, 12 Jan 2017 20:54:03 +0000 (UTC) X-Virus-Scanned: Debian amavisd-new at spamd2-us-west.apache.org X-Spam-Flag: NO X-Spam-Score: 1.979 X-Spam-Level: * X-Spam-Status: No, score=1.979 tagged_above=-999 required=6.31 tests=[DKIM_SIGNED=0.1, DKIM_VALID=-0.1, HTML_MESSAGE=2, RCVD_IN_DNSWL_NONE=-0.0001, RCVD_IN_MSPIKE_H4=-0.01, RCVD_IN_MSPIKE_WL=-0.01, SPF_HELO_PASS=-0.001] autolearn=disabled Authentication-Results: spamd2-us-west.apache.org (amavisd-new); dkim=pass (1024-bit key) header.d=vgbio360.onmicrosoft.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 esC9aj13FIqs for ; Thu, 12 Jan 2017 20:54:02 +0000 (UTC) Received: from NAM02-SN1-obe.outbound.protection.outlook.com (mail-sn1nam02on0106.outbound.protection.outlook.com [104.47.36.106]) by mx1-lw-eu.apache.org (ASF Mail Server at mx1-lw-eu.apache.org) with ESMTPS id 57A7C5F4AE for ; Thu, 12 Jan 2017 20:54:01 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=vgbio360.onmicrosoft.com; s=selector1-physiq-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version; bh=ubYREQ6D3EAEWWaIBQQMAykfhGoDaqQy78EgMuwOutE=; b=oKgonxnRzkI38+bNzOZvnpU8+mzUayoMd0DZyo7T9NcRim1E9XplTcooRh12f+nb605GFK8k80rbYccX5BbhBHFnsWlYWajuTIXy1l3wX9E2jqBmhmsYJ7SXSFn6I1f6DW3B9TCWvLS2ZWOsg6wFK5rZ3sJxnUyDDlcetAtlDh8= Received: from CY1PR02MB1995.namprd02.prod.outlook.com (10.166.189.153) by CY1PR02MB1995.namprd02.prod.outlook.com (10.166.189.153) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384_P384) id 15.1.829.7; Thu, 12 Jan 2017 20:53:53 +0000 Received: from CY1PR02MB1995.namprd02.prod.outlook.com ([10.166.189.153]) by CY1PR02MB1995.namprd02.prod.outlook.com ([10.166.189.153]) with mapi id 15.01.0829.017; Thu, 12 Jan 2017 20:53:53 +0000 From: Paul Joireman To: "user@flink.apache.org" Subject: Getting key from keyed stream Thread-Topic: Getting key from keyed stream Thread-Index: AQHSbRT7a/nIzda/NkaAp2rYWgmFQw== Date: Thu, 12 Jan 2017 20:53:52 +0000 Message-ID: Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: authentication-results: spf=none (sender IP is ) smtp.mailfrom=paul.joireman@physiq.com; x-originating-ip: [132.245.71.21] x-ms-office365-filtering-correlation-id: 82d238e0-d85c-442e-e56b-08d43b2d1e15 x-microsoft-antispam: UriScan:;BCL:0;PCL:0;RULEID:(22001);SRVR:CY1PR02MB1995; x-microsoft-exchange-diagnostics: 1;CY1PR02MB1995;7:fG5toqKNIo37XbkPHkP2038AykLg+DJo+IPU6kOBHyNw28uu30kgh+0q0521e8pqoHxz2t5tYh9yEydnS+IixuQO/wqG0N1vuY7cNce5TT3SmE86aShPjJJpUHabXp8ogC4/sEtBai2LknKfF++hsmv4P1QxsgwtvsVb1rVINpQdLwxOR78QYufSH0XeH9/4yvVWbX//3GLCYBdaesU3cRPG1oSvKnJ8LxQ4YtZDja263xULjPS8/HQIqCw88gVmfmHLLBWlSb8ctdnVZDsW16qPl6OxnyovdnvBlkHCy26Dj7e+XQNFFAf8UYbhuwVgn74L5Z+X90RaPjM6Q3MfjQThcQed2U2FHthgXRur9SlbnEbLPRO9E3fn1fUnKMN5DPXSBl7fIqqhs79cv36TyOCGSIEMNQaYBikB2SWbwB8EJqsi8bzcazu6uWIxT36srDkRrkDv/fDhH/OC1JvIUg== x-microsoft-antispam-prvs: x-exchange-antispam-report-test: UriScan:; x-exchange-antispam-report-cfa-test: BCL:0;PCL:0;RULEID:(6040375)(601004)(2401047)(5005006)(8121501046)(3002001)(10201501046)(6041248)(20161123562025)(20161123564025)(20161123560025)(20161123555025)(2016111802025)(6072148)(6043046);SRVR:CY1PR02MB1995;BCL:0;PCL:0;RULEID:;SRVR:CY1PR02MB1995; x-forefront-prvs: 018577E36E x-forefront-antispam-report: SFV:NSPM;SFS:(10019020)(6009001)(7916002)(39450400003)(39830400002)(39410400002)(189002)(53754006)(199003)(92566002)(2900100001)(50986999)(54356999)(1730700003)(7696004)(110136003)(77096006)(38730400001)(6506006)(33656002)(6436002)(19627405001)(101416001)(5660300001)(2351001)(6916009)(6606003)(25786008)(2501003)(106356001)(86362001)(7736002)(74316002)(66066001)(450100001)(2906002)(106116001)(122556002)(3280700002)(54896002)(8676002)(3660700001)(81166006)(68736007)(8936002)(81156014)(5640700003)(189998001)(6116002)(99286003)(9686003)(55016002)(3846002)(97736004)(107886002)(105586002)(102836003);DIR:OUT;SFP:1102;SCL:1;SRVR:CY1PR02MB1995;H:CY1PR02MB1995.namprd02.prod.outlook.com;FPR:;SPF:None;PTR:InfoNoRecords;MX:1;A:1;LANG:en; received-spf: None (protection.outlook.com: physiq.com does not designate permitted sender hosts) spamdiagnosticoutput: 1:99 spamdiagnosticmetadata: NSPM Content-Type: multipart/alternative; boundary="_000_CY1PR02MB19953697948102483676A23A80790CY1PR02MB1995namp_" MIME-Version: 1.0 X-OriginatorOrg: physiq.com X-MS-Exchange-CrossTenant-originalarrivaltime: 12 Jan 2017 20:53:52.6808 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: ecbda8f3-3c3b-43e4-9663-6beab1acd10b X-MS-Exchange-Transport-CrossTenantHeadersStamped: CY1PR02MB1995 archived-at: Thu, 12 Jan 2017 20:54:10 -0000 --_000_CY1PR02MB19953697948102483676A23A80790CY1PR02MB1995namp_ Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable Hi all, Is there a simple way to read the key from a KeyedStream. Very simply I'm= trying to read a message from Kafka, separate the incoming messages by a f= ield in the message and write the original message back to Kafka using that= field as a new topic. I chose to partition the incoming stream by creatin= g a KeyedStream and using the field from the message as the key. The onl= y thing left is to write the message to Kafka with a producer but i need to= know the topic to write to and for that I need to be able to read the key.= Is there a way to do this? Is there a better way to do this, rather than using a KeyedStream. Paul --_000_CY1PR02MB19953697948102483676A23A80790CY1PR02MB1995namp_ Content-Type: text/html; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable

Hi all,


Is there a simple way to read the key from a KeyedStream.   Very si= mply I'm trying to read a message from Kafka, separate the incoming message= s by a field in the message and write the original message back to Kafka us= ing that field as a new topic.  I chose to partition the incoming stream by creating a KeyedStream and using the f= ield from the message as the key.    The only thing left is to wr= ite the message to Kafka with a producer but i need to know the topic to wr= ite to and for that I need to be able to read the key.   Is there a way to do this?


Is there a better way to do this, rather than using a KeyedStream.


Paul

--_000_CY1PR02MB19953697948102483676A23A80790CY1PR02MB1995namp_--