Processing guarantees
Pulsar Functions provides three different messaging semantics that you can apply to any function:
| Delivery semantics | Description |
|---|---|
| At-most-once delivery | Each message that is sent to the function will most likely be processed but also may not be (hence the "at most") |
| At-least-once delivery | Each message that is sent to the function could be processed more than once (hence the "at least") |
| Effectively-once delivery | Each message that is sent to the function will have one output associated with it |
Applying processing guarantees to a function
You can set the processing guarantees for a Pulsar Function when you create the Function. This pulsar-function create command, for example, would apply effectively-once guarantees to the Function:
$ bin/pulsar-admin functions create \
--processing-guarantees EFFECTIVELY_ONCE \
# Other function configs
The available options are:
ATMOST_ONCEATLEAST_ONCEEFFECTIVELY_ONCE
By default, Pulsar Functions provide at-least-once delivery guarantees. So if you create a function without supplying a value for the
--processingGuaranteesflag, then the function will provide at-least-once guarantees.
Updating the processing guarantees of a function
You can change the processing guarantees applied to a function once it's already been created using the update command. Here's an example:
$ bin/pulsar-admin functions update \
--processing-guarantees ATMOST_ONCE \
# Other function configs