[fix][client] Add support for loading non-serializable properties with ConsumerBuilder::loadConf - #18344
[fix][client] Add support for loading non-serializable properties with ConsumerBuilder::loadConf#18344cbornet wants to merge 1 commit into
Conversation
d9c93a1 to
f7ef902
Compare
eolivelli
left a comment
There was a problem hiding this comment.
This patch adds value.
The only downside is that in case we add a new non serialisable field we will have to add it to this list
michaeljmarshall
left a comment
There was a problem hiding this comment.
I think this approach generally makes sense since something like a messageListener would not be expected to be "deep copied".
| configurationData.setNegativeAckRedeliveryBackoff(negativeAckRedeliveryBackoff); | ||
| configurationData.setAckTimeoutRedeliveryBackoff(ackTimeoutRedeliveryBackoff); |
There was a problem hiding this comment.
Is it worth just making these two (and some of the others) serializable?
There was a problem hiding this comment.
The hardest part is making them work with Jackson. Not sure it's possible for RedeliveryBackoff
There was a problem hiding this comment.
I believe RB can be serialized by configuring a mix-in (on the mapper) that provides a json creator constructor for RB. Not saying that it is ideal, just that it can be done.
There was a problem hiding this comment.
RB being an interface. I'm not sure it can be done. How to decide which impl to use ?
There was a problem hiding this comment.
In that case we could use @JsonTypeInfo + @JsonSubTypes in a mix-in. This would work well as long as we know about all of the RB impls.
NOTE: Whatever we do for RB could apply to the ClientConfigurationData.authentication as it also currently ignored and is also an interface. There may be other fields as well.
2d7b1f6 to
4b6b973
Compare
Codecov Report✅ All modified and coverable lines are covered by tests. 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
Flags with carried forward coverage won't be shown. Click here to find out more.
🚀 New features to boost your workflow:
|
4b6b973 to
98e6e37
Compare
|
The pr had no activity for 30 days, mark with Stale label. |
Motivation
Currently
ConsumerBuilder::loadConfresets non-serializable ofConsumerConfigurationDatatonull.It would be useful that
ConsumerBuilder::loadConfsupports loading non-serializable fields.An alternative is to not modify fields not present in the property map in
ConfigurationDataUtils::loadDataas proposed by #13298 . This PR is for discussion.Modifications
In
ConsumerBuilder::loadConf, save values for each non-serializable property and apply it after callingConfigurationDataUtils::loadDataVerifying this change
This change added tests and can be verified as follows:
ConsumerBuilderImplTest::testLoadConfandConsumerBuilderImplTest::testLoadConfNotModifiedDoes this pull request potentially affect one of the following parts:
If the box was checked, please highlight the changes
Documentation
docdoc-requireddoc-not-neededdoc-completeMatching PR in forked repository
PR in forked repository: cbornet#7