Managing functions
Pulsar Functions are lightweight compute processes that
- consume messages from one or more Pulsar topics
- apply a user-supplied processing logic to each message
- publish the results of the computation to another topic
Functions can be managed via the following methods.
Method | Description |
---|---|
Admin CLI | The functions command of the pulsar-admin tool. |
REST API | The /admin/v3/functions endpoint of the admin REST API. |
Java Admin API | The functions method of the PulsarAdmin object in the Java API. |
Function resources
You can perform the following operations on functions.
Create a function
You can create a Pulsar function in cluster mode (deploy it on a Pulsar cluster) using Admin CLI, REST API or Java Admin API.
Admin CLI
Use the create
subcommand.
Example
$ pulsar-admin functions create \
--tenant public \
--namespace default \
--name (the name of Pulsar Functions) \
--inputs test-input-topic \
--output persistent://public/default/test-output-topic \
--classname org.apache.pulsar.functions.api.examples.ExclamationFunction \
--jar /examples/api-examples.jar