You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@pulsar.apache.org by GitBox <gi...@apache.org> on 2020/03/06 18:49:49 UTC
[GitHub] [pulsar] addisonj opened a new pull request #6502: [functions] WIP
Introduce `RichFunction` interface for more control
addisonj opened a new pull request #6502: [functions] WIP Introduce `RichFunction` interface for more control
URL: https://github.com/apache/pulsar/pull/6502
Early commit! Not intended for merge, just discussion.
This commit introduces a new interface `RichFunction` (name subject to
change!) that gives you more control over `Record` object emitted by
functions, here is some reasons for it:
- in some cases where a function has outputs to multiple topics, you
currently need to use the context and manually do sends, however, for
performance reasons, you need to use `sendAsync` which then creates some
issues around error handling and any delivery gurantees are now up to
the user. Since you don't control acks, there are
cases in which you can lose messages in error handling. With this API,
it is trivial to just return a message with an overriden
destinationTopic, which the `PulsarSink` already handles
- in cases where you want to do some work asyncronously, you may want to
control ack-ing to ensure that the async work is completed before you
ack the source message. This gives you the ability to do that
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
With regards,
Apache Git Services