-
Couldn't load subscription status.
- Fork 631
Description
Describe the issue
Default binding properties are ignored when both spring.cloud.stream.<binder>.bindings.<binding>.consumer/producer.<property> and spring.cloud.stream.binders.<custom-binder-name>.environment.<property> are both defined.
To Reproduce
Steps to reproduce the behavior:
- Use the sensor-average-reactive-rabbit sample and upgrade
spring-boot-starter-parentto2.6.2andspring-cloud.versionto2021.0.0. - In this sample's
application.yml, add:
spring:
cloud:
stream:
binders:
local-rabbit:
type: rabbit
environment:
host: localhost
rabbit:
bindings:
receive-in-0:
consumer:
durableSubscription: false
default:
consumer:
anonymousGroupPrefix: 'test.'
management: # Not required to reproduce this issue, but I included it here to enable the actuator endpoint for the next steps
endpoints:
web:
exposure:
include: bindings- Run the application.
- See in actuator that the
receive-in-0binding hasanonymousGroupPrefixset toanonymous., ignoring the default consumer binding property that we had defined atspring.cloud.stream.rabbit.default.consumer.anonymousGroupPrefix.
Now if you were to re-run the application with either spring.cloud.stream.binders.local-rabbit.environment or spring.cloud.stream.rabbit.bindings commented out from application.yml, notice in actuator that the receive-in-0 binding has anonymousGroupPrefix set to test. as expected.
Version of the framework
spring-boot-starter-parent: 2.6.2
spring-cloud-dependencies: 2021.0.0
Expected behavior
Default binding properties should be applied when spring.cloud.stream.<binder>.bindings.<binding>.consumer/producer.<property> and spring.cloud.stream.binders.<custom-binder-name>.environment.<property> are both defined in application.yml.
In step 4 of the issue reproduction, we should have seen anonymousGroupPrefix set to test., not anonymous..
Additional context
This issue was originally found using the Solace PubSub+ binder. See SolaceProducts/solace-spring-cloud#29.