fix scs sources cannot be appended to Kafka binder context - #31715
Merged
Conversation
Collaborator
|
API change check APIView has identified API level changes in this PR and created following API reviews. |
yiliuTo
marked this pull request as ready for review
October 25, 2022 08:41
yiliuTo
requested review from
Netyyyy,
backwind1233,
chenrujun,
fangjian0423,
hui1110,
moarychan,
saragluna and
stliu
as code owners
October 25, 2022 08:41
saragluna
requested changes
Oct 25, 2022
| * @param flattenedProperties map to which we'll add the falttened property | ||
| */ | ||
| @SuppressWarnings("unchecked") | ||
| private void flatten(String propertyName, Object value, |
Member
There was a problem hiding this comment.
Why not return a map instead passing in the map?
Member
There was a problem hiding this comment.
And hide the recursive call in another method?
| (propertyName != null ? propertyName + "." : "") + k, v, | ||
| flattenedProperties)); | ||
| } else { | ||
| flattenedProperties.put(propertyName, value.toString()); |
Member
There was a problem hiding this comment.
Seems like the flattenedProperties can be Map<String, String>?
saragluna
reviewed
Oct 25, 2022
|
|
||
| private String buildKafkaBinderSources(BinderProperties binderProperties) { | ||
| Map<String, Object> flattenedProperties = new HashMap<>(); | ||
| flatten(null, binderProperties.getEnvironment(), flattenedProperties); |
Member
There was a problem hiding this comment.
So what's the spring.main.sources property name like in this env?
saragluna
approved these changes
Oct 27, 2022
yiliuTo
added a commit
to yiliuTo/azure-sdk-for-java
that referenced
this pull request
Oct 28, 2022
yiliuTo
added a commit
to yiliuTo/azure-sdk-for-java
that referenced
this pull request
Oct 28, 2022
yiliuTo
added a commit
that referenced
this pull request
Oct 28, 2022
yiliuTo
added a commit
that referenced
this pull request
Oct 28, 2022
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.
Description
As subject. Currently when overriding Kafka binder context's sources, we detected the origin sources by property key of
spring.main.sources. However, this property is stored in a Map thus its key is not flattened by default. Fix it by flatten it manually like how Spring Cloud Stream does.All SDK Contribution checklist:
General Guidelines and Best Practices
Testing Guidelines