Hi, Flink dev and users

If I want to async write to an external service, which API shall I use,
AsyncFunction or Async Sink?

My understanding after checking the code are:

   1. Both APIs guarantee at least once write to external service. As both
   API internally stores in-flight requests in the checkpoint.
   2. Async Sink provides a batching request feature. This can be
   implemented with Map + AsyncFunction. Map function groups requests in
   batches and pass it to AsyncFunction.The batching implementation can refer
   to AbstractMapBundleOperator if don’t want to use state.
   3. Async Sink supports retry on failed requests. AsyncFunction also
   supports retry in latest flink version.
   4. Async Sink supports rate limiting, AsyncFunction doesn’t.
   5. AsyncFunction can be used to implement read-update-write. Async Sink
   cannot.

Best

Lu

Reply via email to