From user-return-23652-archive-asf-public=cust-asf.ponee.io@flink.apache.org Fri Oct 12 16:21:25 2018 Return-Path: X-Original-To: archive-asf-public@cust-asf.ponee.io Delivered-To: archive-asf-public@cust-asf.ponee.io Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by mx-eu-01.ponee.io (Postfix) with SMTP id 1E067180660 for ; Fri, 12 Oct 2018 16:21:24 +0200 (CEST) Received: (qmail 31269 invoked by uid 500); 12 Oct 2018 14:21:23 -0000 Mailing-List: contact user-help@flink.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Delivered-To: mailing list user@flink.apache.org Received: (qmail 31259 invoked by uid 99); 12 Oct 2018 14:21:23 -0000 Received: from pnap-us-west-generic-nat.apache.org (HELO spamd1-us-west.apache.org) (209.188.14.142) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 12 Oct 2018 14:21:23 +0000 Received: from localhost (localhost [127.0.0.1]) by spamd1-us-west.apache.org (ASF Mail Server at spamd1-us-west.apache.org) with ESMTP id 69E8FC1E1C for ; Fri, 12 Oct 2018 14:21:23 +0000 (UTC) X-Virus-Scanned: Debian amavisd-new at spamd1-us-west.apache.org X-Spam-Flag: NO X-Spam-Score: 1.898 X-Spam-Level: * X-Spam-Status: No, score=1.898 tagged_above=-999 required=6.31 tests=[DKIMWL_WL_MED=-0.001, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, HTML_MESSAGE=2, KAM_SHORT=0.001, RCVD_IN_DNSWL_NONE=-0.0001, RCVD_IN_MSPIKE_H2=-0.001, SPF_PASS=-0.001] autolearn=disabled Authentication-Results: spamd1-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 (spamd1-us-west.apache.org [10.40.0.7]) (amavisd-new, port 10024) with ESMTP id a8E-eTSGmKif for ; Fri, 12 Oct 2018 14:21:22 +0000 (UTC) Received: from mail-wm1-f44.google.com (mail-wm1-f44.google.com [209.85.128.44]) by mx1-lw-eu.apache.org (ASF Mail Server at mx1-lw-eu.apache.org) with ESMTPS id B99575F48E for ; Fri, 12 Oct 2018 14:21:21 +0000 (UTC) Received: by mail-wm1-f44.google.com with SMTP id z204-v6so13152740wmc.5 for ; Fri, 12 Oct 2018 07:21:21 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=5JFq0ikY0GCF9bqG5PNuY6CL9589kZ7TSJ/OCETcAhE=; b=J+wZpGTWz73BkBJAGANLGIkN369AsiIa4vFPSaIYRUo4wJzAKVf+E9z32FsWzxB4tX I6Z6QJlsrDe+r1kASuFtZ5hmHiqbMoLuw/U22PTLd5slVXXLrx16wGzgjCdCvGd242Zy fgHpIG+LCk0NGJcZYvYadZNwnm3DHMcgGq2Y+h3KBHalI6kFDBbtLtD1d0sAvfVwLS/w 4fcR0a0RvgpCT4gEaImzn/Pc3sUBDCZuVzcdf6+Au2jQcw5MO8U6jAypvtoudKcUzn8z zJLUggZsmLYSJMUtA5dNXG+6mo9O3SmqHrTSRIE7r6Gouv5WIjxdKH/F1nSYM+FTzr7J t2EA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=5JFq0ikY0GCF9bqG5PNuY6CL9589kZ7TSJ/OCETcAhE=; b=YBk37ER4Pf2vFtVq8eSNW4HOdK5jfuPujdJTPmYaudJ73xfgCxo8P6voOu+2Ivz/JS pcDC+d22ZHjKwPP8Last/tqf+RGTRTj/2cvuWLo3ItpLJp9/cykqY0JbtyPuPkZN0Ew3 QWVQTu6fV/jqx7OrdYsgRRGiJrQ0CM0vc1FJOBjJr79iST2oFRAKnpuL+Qqi9QKTEFxW 4EK0FQKm+mIHfgut/822rdost5Ccqaw0bOc6aPBU9PA/ugumgprlukbNOzfgvQjhUL+8 2ks3oP4DKzpHZNW/v/Re8Igt4oG0zPb2Rx9SfKuUm05UvFx3fbz2Qz1B3PXXN9ngKjE5 3tmQ== X-Gm-Message-State: ABuFfoib6HtYXtjvoVZAVJYfKf6j/q+tIJJbp2jUJH+1i8sG/i5j4Wqj Tj21WdHNiFIhzKmFfnStUOgNeNRmYssWaeRcDNc= X-Google-Smtp-Source: ACcGV60vjDBtYAu7BDcG0RArtUtYh+VvexB51YDrhAuKVBUwn/wxRae0+qLPPcOhNuFw95WXVoJGpcPeGau5WL9XQSc= X-Received: by 2002:a1c:9d43:: with SMTP id g64-v6mr5111485wme.26.1539354081285; Fri, 12 Oct 2018 07:21:21 -0700 (PDT) MIME-Version: 1.0 References: In-Reply-To: From: =?UTF-8?Q?Dominik_Wosi=C5=84ski?= Date: Fri, 12 Oct 2018 16:21:09 +0200 Message-ID: Subject: Re: Making calls to external API wit Data Streams To: krishna.kalyan@zoi.de Cc: user Content-Type: multipart/alternative; boundary="00000000000032dde6057808cd62" --00000000000032dde6057808cd62 Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable Hey, What is the exact issue that you are facing and the Flink version that you are using ?? Best Regards, Dom. pt., 12 pa=C5=BA 2018 o 16:11 Krishna Kalyan napisa= =C5=82(a): > Hello All, > > I need some help making async API calls. I have tried the following code > below. > > class AsyncWeatherAPIRequest extends AsyncFunction[String, String] { > override def asyncInvoke(input: String, resultFuture: > ResultFuture[String]): Unit =3D { > val query =3D url("") > val response =3D Http.default(query OK as.String) > resultFuture.complete(Collections.singleton(response())) > } > } > > The code below leads to a compilation issue while calling the > AsyncDataStream api. > > val resultStream: DataStream[(String, String)] =3D > AsyncDataStream.unorderedWait(userData, new > AsyncWeatherAPIRequest(), 1000, TimeUnit.MILLISECONDS, 1) > > I would really appreciate some examples in scala to make an external API > call with datastreams. > > Regards, > Krishna > > > > Standorte in Stuttgart und Berlin =C2=B7 Zoi > TechCon GmbH =C2=B7 Quellenstr. 7 =C2=B7 70376 Stuttgart =C2=B7 Gesch=C3= =A4ftsf=C3=BChrer: Benjamin > Hermann, Dr. Daniel Heubach. Amtsgericht Stuttgart HRB 759619, > Gerichtsstand Stuttgart. Die genannten Angaben werden automatisch > hinzugef=C3=BCgt und lassen keine R=C3=BCckschl=C3=BCsse auf den Rechtsch= arakter der > E-Mail zu. This message (including any attachments) contains confidential > information intended for a specific individual and purpose, and is > protected by law. If you are not the intended recipient, you should delet= e > this message. Any disclosure, copying, or distribution of this message, o= r > the taking of any action based on it, is strictly prohibited. > > --00000000000032dde6057808cd62 Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable
Hey,=C2=A0
What is the exact issue that you are facing = and the Flink version that you are using ??=C2=A0


Best Regards,<= br>Dom.

pt., 12 pa=C5= =BA 2018 o 16:11=C2=A0Krishna Kalyan <krishna.kalyan@zoi.de> napisa=C5=82(a):
Hello All,
<= div>
I need some help making async API calls. I have tried th= e following code below.

class AsyncWeatherAPIReque= st extends AsyncFunction[String, String] {
=C2=A0 override def as= yncInvoke(input: String, resultFuture: ResultFuture[String]): Unit =3D {
=C2=A0 =C2=A0 val query =3D url("<External API URL>"= ;)
=C2=A0 =C2=A0 val response =3D Http.default(query OK as.String= )
=C2=A0 =C2=A0 resultFuture.complete(Collections.singleton(respo= nse()))
=C2=A0 }
}

The code be= low leads to a compilation issue while calling the AsyncDataStream=C2=A0api= .=C2=A0

=C2=A0 =C2=A0 val resultStream: DataStream= [(String, String)] =3D
=C2=A0 =C2=A0 =C2=A0 AsyncDataStream.unord= eredWait(userData, new AsyncWeatherAPIRequest(), 1000, TimeUnit.MILLISECOND= S, 1)

I would really appreciate some examples in s= cala=C2=A0to make an external API call with datastreams.

Regards,
Krishna
=C2=A0 =C2=A0 =C2=A0=C2=A0

Standorte in Stuttgart und Berlin= =C2=A0=C2=B7=C2=A0Zoi T= echCon GmbH =C2=B7 Quellenstr. 7 =C2=B7 70376 Stuttgart =C2=B7 Gesch=C3=A4f= tsf=C3=BChrer: Benjamin Hermann, Dr. Daniel Heubach. Amtsgericht Stuttgart = HRB 759619, Gerichtsstand Stuttgart. Die genannten Angaben werden automatis= ch hinzugef=C3=BCgt und lassen keine R=C3=BCckschl=C3=BCsse auf den Rechtsc= harakter der E-Mail zu. This message (including any attachments) contains c= onfidential information intended for a specific individual and purpose, and= is protected by law. If you are not the intended recipient, you should del= ete this message. Any disclosure, copying, or distribution of this message,= or the taking of any action based on it, is strictly prohibited.
--00000000000032dde6057808cd62--