Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

new docs for "Support for launching Pulsar Functions using configuration files" #541

Closed
wants to merge 1 commit into from
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
30 changes: 30 additions & 0 deletions docs/functions-runtime-process.md
Original file line number Diff line number Diff line change
Expand Up @@ -22,3 +22,33 @@ functionRuntimeFactoryConfigs:
```

For more details, see [code](https://github.com/apache/pulsar/blob/master/pulsar-functions/runtime/src/main/java/org/apache/pulsar/functions/runtime/process/ProcessRuntimeFactoryConfig.java).

Pulsar Functions now supports setting runtime parameters using a configuration file. Currently, only the Python Runtime is supported. The path to the configuration file can be specified with the `--config-file` parameter.

The configuration file should be written in `.ini` format, with each parameter being configured as `key = value`. Here's an example:

```ini
[DEFAULT]
logging_level = info
max_pending_async_requests = 1000
max_concurrent_requests = 50
```

Note that parameters in the configuration file will override those of the same name specified on the command line.

Let's assume we have a configuration file named `config.ini` with the above contents. Then we can start the Python Runtime using the configuration file with the following command:

```shell
pulsar-admin functions localrun \
--py /path/to/python_instance.py \
--config-file /path/to/config.ini \
--classname MyFunction \
--logging_leve debug \
--inputs persistent://public/default/my-input-topic \
--output persistent://public/default/my-output-topic \
--log-topic persistent://public/default/functions-logs
```

This starts the Python Runtime with the parameters specified in the configuration file.

Note that when starting with a configuration file, all parameters can be set in the configuration file. If you specify parameters on the command line that are also present in the configuration file, the values of the parameters on the command line will take precedence over the values in the configuration file (In the example above, the `logging_level` will be set to `debug`).