Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Specific bindings params is overridden by default ones #1359

Closed
Viacheslav-Petriaiev opened this issue Apr 13, 2018 · 1 comment
Closed

Specific bindings params is overridden by default ones #1359

Viacheslav-Petriaiev opened this issue Apr 13, 2018 · 1 comment
Assignees
Labels
Milestone

Comments

@Viacheslav-Petriaiev
Copy link

I have a configuration

spring:
  cloud:
    stream:
      default:
        contentType: someDefaultContentType
      bindings:
        someChannel:
          contentType: someSpecificContentType

and someChannel.contentType is someDefaultContentType instead of someSpecificContentType

I've investigated the class
https://github.com/spring-cloud/spring-cloud-stream/blob/master/spring-cloud-stream/src/main/java/org/springframework/cloud/stream/config/EnvironmentEntryInitializingTreeMap.java

Default configuration overrides the specific configuration, instead of merge mechanism

Is it a bug or it works as designed?
If it works as designed, the param name "default" is ambiguous, because default usually can be overridden with non-default value
It would be very convenient behavior when default values can be overridden with specific ones

@olegz olegz self-assigned this Jun 14, 2018
@olegz olegz added this to the 2.1.0.M1 milestone Jun 14, 2018
@olegz
Copy link
Contributor

olegz commented Jun 14, 2018

I will look into it shortly, but based on your description it could very well be a bug. Thanks for reporting it.

@olegz olegz added the bug label Jun 25, 2018
@olegz olegz closed this as completed in da9658e Jun 25, 2018
olegz added a commit to olegz/spring-cloud-stream that referenced this issue Jul 11, 2018
Ensured that default property only takes affect if the actual binding property is not set.
For example if "spring.cloud.stream.bindings.output.producer.partitionCount=4" and "spring.cloud.stream.default.producer.partitionCount=1" are both set
the actual binidng property (i.e., 4)  should take precedence

Resolves spring-cloud#1359
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants