[fix][client] Add support for loading non-serializable properties with ConsumerBuilder::loadConf
Motivation
Currently ConsumerBuilder::loadConf resets non-serializable of ConsumerConfigurationData to null.
It would be useful that ConsumerBuilder::loadConf supports loading non-serializable fields.
An alternative is to not modify fields not present in the property map in ConfigurationDataUtils::loadData as proposed by https://github.com/apache/pulsar/pull/13298 . This PR is for discussion.
Modifications
In ConsumerBuilder::loadConf, save values for each non-serializable property and apply it after calling ConfigurationDataUtils::loadData
Verifying this change
- [ ] Make sure that the change passes the CI checks.
This change added tests and can be verified as follows:
- Run
ConsumerBuilderImplTest::testLoadConfandConsumerBuilderImplTest::testLoadConfNotModified
Does this pull request potentially affect one of the following parts:
If the box was checked, please highlight the changes
- [ ] Dependencies (add or upgrade a dependency)
- [ ] The public API
- [ ] The schema
- [ ] The default values of configurations
- [ ] The threading model
- [ ] The binary protocol
- [ ] The REST endpoints
- [ ] The admin CLI options
- [ ] Anything that affects deployment
Documentation
- [ ]
doc - [ ]
doc-required - [x]
doc-not-needed - [ ]
doc-complete
Matching PR in forked repository
PR in forked repository: https://github.com/cbornet/pulsar/pull/7
Codecov Report
:white_check_mark: All modified and coverable lines are covered by tests.
:white_check_mark: Project coverage is 45.85%. Comparing base (545f33f) to head (98e6e37).
:warning: Report is 3040 commits behind head on master.
Additional details and impacted files
@@ Coverage Diff @@
## master #18344 +/- ##
============================================
+ Coverage 43.96% 45.85% +1.89%
+ Complexity 10358 10117 -241
============================================
Files 757 697 -60
Lines 72773 68044 -4729
Branches 7818 7285 -533
============================================
- Hits 31993 31203 -790
+ Misses 37104 33259 -3845
+ Partials 3676 3582 -94
| Flag | Coverage Δ | |
|---|---|---|
| unittests | 45.85% <100.00%> (+1.89%) |
:arrow_up: |
Flags with carried forward coverage won't be shown. Click here to find out more.
| Files with missing lines | Coverage Δ | |
|---|---|---|
| ...apache/pulsar/client/impl/ConsumerBuilderImpl.java | 48.41% <100.00%> (+6.70%) |
:arrow_up: |
:rocket: New features to boost your workflow:
- :snowflake: Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
- :package: JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.
The pr had no activity for 30 days, mark with Stale label.