HTTP post request example for async IO

classic Classic list List threaded Threaded
3 messages Options
Reply | Threaded
Open this post in threaded view
|

HTTP post request example for async IO

shashank734
Hello,

Is anybody has an example of HTTP post request using Async io? 

Shashank




Reply | Threaded
Open this post in threaded view
|

Re: HTTP post request example for async IO

Stefan Richter
Hi,

did you see the example code in the documentation here: https://ci.apache.org/projects/flink/flink-docs-release-1.3/dev/stream/asyncio.html ? This code does async calls agains a database, but I think it should be straight forward to replace this part

Future<String> resultFuture = client.query(str);
with your HTTP post request call, returning a Future.

Best,
Stefan


Am 21.11.2017 um 11:46 schrieb shashank agarwal <[hidden email]>:

Hello,

Is anybody has an example of HTTP post request using Async io? 

Shashank





Reply | Threaded
Open this post in threaded view
|

Re: HTTP post request example for async IO

shashank734
Hi,

Yes, I got this point. Actually, i was looking for HTTP client suggestion. Like currently I am using http4s with the normal Map function. But I have seen users are facing issues in AsyncHttpClient. If anybody used that before.

Thanks
Shashank




On Tue, Nov 21, 2017 at 7:17 PM, Stefan Richter <[hidden email]> wrote:
Hi,

did you see the example code in the documentation here: https://ci.apache.org/projects/flink/flink-docs-release-1.3/dev/stream/asyncio.html ? This code does async calls agains a database, but I think it should be straight forward to replace this part

Future<String> resultFuture = client.query(str);
with your HTTP post request call, returning a Future.

Best,
Stefan


Am 21.11.2017 um 11:46 schrieb shashank agarwal <[hidden email]>:

<img width="0" height="0" class="m_-1845724657363558554mailtrack-img" alt="" style="display:flex" src="data:image/gif;base64,R0lGODlhAQABAIAAAAAAAP///yH5BAEAAAAALAAAAAABAAEAAAIBRAA7">Hello,

Is anybody has an example of HTTP post request using Async io? 

Shashank








--
Thanks Regards

SHASHANK AGARWAL
 ---  Trying to mobilize the things....