Update Pulsar client from 4.1.2 to 4.2.4 - #234
Merged
Merged
Conversation
Pulsar 4.2 added the `DecryptFailListener` feature and changed how `cryptoFailureAction` is defaulted. `ConsumerConfigurationData` no longer initializes the field to `ConsumerCryptoFailureAction.FAIL`; it now defaults to `null`, and `ConsumerBuilderImpl.subscribeAsync` applies `FAIL` at subscribe time only when neither `cryptoFailureAction` nor `decryptFailListener` is set. `AdaptedReactiveMessageConsumerTests` stubs `subscribeAsync` with an expected `ConsumerConfigurationData` built by hand, so the expected conf held `null` while the conf passed by the builder held `FAIL`. The stub no longer matched and the tests failed with "didn't match expected consumer conf". Set the expected default explicitly in `keySharedPolicy` and `topicsPattern`. No production change is needed: the adapter correctly leaves `cryptoFailureAction` unset when the spec does not specify it, which lets Pulsar apply its own default and keeps `decryptFailListener` usable. Signed-off-by: Lari Hotari <lhotari@users.noreply.github.com>
onobc
approved these changes
Aug 3, 2026
onobc
approved these changes
Aug 4, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This commit updates the following dependency version:
4.1.2to4.2.4Test fix required by the upgrade
Two tests in
AdaptedReactiveMessageConsumerTests(keySharedPolicyandtopicsPattern) started failing withdidn't match expected consumer conf.Pulsar 4.2 added the
DecryptFailListenerfeature and changed howcryptoFailureActionis defaulted:ConsumerConfigurationData.cryptoFailureActionwas initialized toConsumerCryptoFailureAction.FAILat field declaration.null.ConsumerBuilderImpl.subscribeAsyncrejects setting bothdecryptFailListenerandcryptoFailureAction, and appliesFAILto the conf just before subscribing only when neither is set.These tests stub
subscribeAsync(eq(expectedConsumerConf), ...)with aConsumerConfigurationDatabuilt by hand, falling back to a future that fails withdidn't match expected consumer conf. The expected conf heldnullforcryptoFailureActionwhile the conf actually passed by the builder heldFAIL, so the stub no longer matched.consumerPropertieswas unaffected because it setsDISCARDexplicitly on both sides.The fix sets the expected default explicitly in the two tests.
No production change
AdaptedReactiveMessageConsumer.configureConsumerBuildercorrectly leavescryptoFailureActionunset when the spec does not specify it, which lets Pulsar apply its own default. HardcodingFAILin the adapter would preserve current behavior but would permanently blockdecryptFailListenershould it ever be exposed throughReactiveMessageConsumerSpec.Verification
./gradlew checkpasses: 149 tests, 0 failures, 0 errors.