Repository navigation
Conversation
|
/pulsarbot run-failure-checks |
2 similar comments
|
/pulsarbot run-failure-checks |
|
/pulsarbot run-failure-checks |
|
/pulsarbot run-failure-checks |
|
@jerrypeng @sijie @codelipenghui @freeznet I got all the tests to pass (after 5 runs...), and this PR needs a review. |
|
This PR is the derivative of #9987 |
|
Also @eolivelli |
| Producer<O> newProducer = null; | ||
|
|
||
| if (this.config.getFunctionDetails() != null && this.config.getFunctionDetails().getSink() != null && | ||
| this.config.getFunctionDetails().getSink().getProducerSpec() != null){ |
There was a problem hiding this comment.
this.config.getFunctionDetails().getSink().getProducerSpec() will never return null. This is technically changing the existing behavior of publish when called from Context. I don't think this is the right change. If a user want to use a custom producer to produce in the function (instead of just returning), the user should be able to:
- Instantiate a PulsarClient, create a producer, and sent messages (already can do this today)
- We can add a new method called "newProducerBuilder()" to the Context in which the returned builder automatically inherits some of the settings such as authentication from the function.
There was a problem hiding this comment.
@jerrypeng Thanks for reviewing the PR. I want to better understand your suggestion. I'm hearing several things, so please correct any of my misunderstandings:
- Instead of performing the null check on
this.config.getFunctionDetails().getSink().getProducerSpec(), I could skip the null check and just pass through the protobuf properties directly. The defaults they use match the existing configurations, but it sounds like there's a concern that it could still change existing behavior? - You're saying that I could define a new method,
newProducerBuilder()to inherit the protobuf settings (instead of passing them through directly, like I mentioned above), but it sounds like there are other settings I'd want to inherit as well (such as relating to authentication)?
Would the newProducerBuilder() method be used instead of getProducer() by functions that want to use the new settings? It sounds like that would require a code change for any existing function that we want to update to use the new settings. Is that right?
|
The pr had no activity for 30 days, mark with Stale label. |
|
@devinbost:Thanks for your contribution. For this PR, do we need to update docs? |
|
Closed as stale and conflict. Please rebase and resubmit the patch if it's still relevant. |
Part 1 of [Proposal] PIP 84: Cluster-Wide and Function-Specific Producer Defaults
For details, see the mailing list discussion
Fixes #9986
This PR adds these properties to
ProducerConfig:It updates the methods that convert between the
ProducerConfigand the protobufProducerSpec.It adds logic to use the new function producer settings when they are provided; otherwise, it reverts to the prior behavior.
It also refactors the
FunctionResultRouterto prevent a race condition onisBatchingEnabled.It adds these properties to
ProducerSpecinFunction.proto:and adds these new enums to Function.proto:
The new protobuf files have not yet been generated for Python and Go functions, but those changes are planned in a subsequent PR.
Existing tests have been updated to include the new properties, and additional tests have been provided to ensure that new configs merge properly into existing configs during function registration/update.
Changes did not need to be made to the Admin CLI parameters because the Admin CLI already provides a way for the
ProducerConfigto be provided as a JSON string.Docs will be provided in a subsequent PR.