-
Notifications
You must be signed in to change notification settings - Fork 326
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
Spring Cloud GCP Pub/Sub Binder: default consumer configuration property effect is nullified when binding level config defined #2151
Comments
It looks like the way Cloud Stream works is that defaults are only used when no properties are specified for the specific binding. I'm not sure why there isn't some kind of merging of the properties. @artembilan can you please advise here? |
The
Apparently you are right: there is no merge if we have binding-specific properties and that default |
@artembilan, I know the config you mentioned would work. I was hoping merging to work, so if I have many bindings I don't have to repeat auto-create-resources=false. I know Solace Binder does automatic merging. I'm will have to verify if Kafka binder does merging or not. |
@artembilan Interesting, something like this was done back in https://github.com/spring-attic/spring-cloud-gcp/pull/1107/files#diff-740698cdd78cb559d5ba86af224be4e027dfafa169ec34544052662c4313fb0aR59. However, it looks like adding it to |
Yes, that correct.
But every binder and its configuration is processed only later on by the next bean in this config: Please, consider to fix this problem same way as it is done in other binders. Sorry for inconvenience. I also feel like I would add simple beans to the binder config. However this is not how things work. |
I'm using v3.6.3 of spring-cloud-gcp-pubsub-stream-binder. I have multiple consumer and producer bindings in my sample application.
I'm trying to disable auto resource (topic/subscription) creation globally for all consumers, however the resources are still being created in case of below mentioned scenario.
I'm using this sample sink for reproduction with below configuration changes.
My configuration:
spring.cloud.stream.gcp.pubsub.default.consumer.auto-create-resources=false
#spring.cloud.stream.bindings.input.group=my-group
spring.cloud.stream.gcp.pubsub.bindings.input.consumer.subscription-name=gcp-pubsub-topic-sub
As soon as
spring.cloud.stream.gcp.pubsub.bindings.input.consumer.subscription-name
property is added, effect ofspring.cloud.stream.gcp.pubsub.default.consumer.auto-create-resources
is nullified.i.e. in other words if
spring.cloud.stream.gcp.pubsub.bindings.input.consumer.subscription-name
is removed,spring.cloud.stream.gcp.pubsub.default.consumer.auto-create-resources=false
would not create any resources as expected.Here is complete configuration:
Background
I'm developing an application that has multiple consumer functions and multiple publisher functions.
I want an ability to globally enable/disable resource creation for all consumers, publisher.
The text was updated successfully, but these errors were encountered: