GitHub user nlu90 added a comment to the discussion: Pulsar Functions lifecycle 
and depolyment details.

1. Running Function Worker with Pulsar Brokers is fine for testing purposes. In 
a production env, running Function Worker and Pulsar Broker separately is 
recommended so your Broker will be more stable. The ThreadRuntime will launch 
your function inside Function Worker's thread pool, and ProcessRuntime will 
launch separate JVM processes for your functions.

2.a. You can control how many instances for your function via `pulsar-admin 
functions create --parallelism `. Once submitted, it won't change during the 
runtime. 

2.b. You are responsible for making your function thread-safe and not blocking 
on the process method.

3.a. You only need to send the request once. If the same request is submitted 
multiple times, later requests will be rejected due to the `Already Exists` 
error.

3.b. Function Worker will try to shut down the instance for 10 seconds timeout 
gracefully. After 10 seconds, it will forcibly terminate the process. One thing 
to notice is that, as long as the subscription is not cleaned, the newly 
updated function instance will start from where the old instances stopped to 
continue the message processing.

GitHub link: 
https://github.com/apache/pulsar/discussions/20195#discussioncomment-5773367

----
This is an automatically sent email for commits@pulsar.apache.org.
To unsubscribe, please send an email to: commits-unsubscr...@pulsar.apache.org

Reply via email to