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

Kafka Streams auto-configuration should only configure default streams builder #16329

Closed
garyrussell opened this issue Mar 26, 2019 · 4 comments
Assignees
Labels
type: bug A general bug
Milestone

Comments

@garyrussell
Copy link
Contributor

KafkaStreamsAnnotationDrivenConfiguration

	@Bean
	public KafkaStreamsFactoryBeanConfigurer kafkaStreamsFactoryBeanConfigurer(
			StreamsBuilderFactoryBean factoryBean) {
		return new KafkaStreamsFactoryBeanConfigurer(this.properties, factoryBean);
	}

This blows up if there are multiple factory beans. Consider making it an ObjectProvider and getIfUnique() (or resolve in some other way).

2 people have reported this issue recently on Stack Overflow and today.

@spring-projects-issues spring-projects-issues added the status: waiting-for-triage An issue we've not yet triaged label Mar 26, 2019
@snicoll snicoll added type: bug A general bug and removed status: waiting-for-triage An issue we've not yet triaged labels Mar 27, 2019
@snicoll snicoll added this to the 2.1.x milestone Mar 27, 2019
@snicoll snicoll self-assigned this Mar 27, 2019
@snicoll
Copy link
Member

snicoll commented Mar 27, 2019

Consider making it an ObjectProvider and getIfUnique()

@garyrussell looking at the conversation I am not sure sure about that. If someone creates their own bean, we should not apply our configuration to it so setting the autoStartup flag on the @Primary one feels wrong to me.

Looking at the discussion on the first post, it looks like they want to add something and still use the defaults provided by @EnableKafkaStreams. Regardless of wether we want to do that or not, we should not configure something that the user has configured IMO.

We already have a @ConditionalOnBean(name = KafkaStreamsDefaultConfiguration.DEFAULT_STREAMS_BUILDER_BEAN_NAME) at class level. I believe we should apply the same logic there.

@snicoll snicoll changed the title Consider making Kafka Streams auto-configuration parameter an ObjectProvider Kafka Streams auto-configuration should only configure default streams builder Mar 27, 2019
@snicoll snicoll modified the milestones: 2.1.x, 2.1.4 Mar 27, 2019
@garyrussell
Copy link
Contributor Author

@snicoll Makes sense; thanks for addressing it.

@vspiliopoulos

This comment has been minimized.

@snicoll

This comment has been minimized.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
type: bug A general bug
Projects
None yet
Development

No branches or pull requests

4 participants