spring-cloud / spring-cloud-stream

Framework for building Event-Driven Microservices
http://cloud.spring.io/spring-cloud-stream
Apache License 2.0
1k stars 610 forks source link

Investigate bean override for ServerController #1448

Closed sabbyanandan closed 5 years ago

sabbyanandan commented 6 years ago

Relates to AvroSchemaRegistry support.

olegz commented 6 years ago

I just had to take a look at it while working on another problem and it appears that ServerController bean declared in SchemaServerConfiguration is completely redundant as it doesn't override anything nor it provides any extra features/functionality. So simply removing it from SchemaServerConfiguration is all that is needed IMO.

sabbyanandan commented 6 years ago

It appears the sample breaks when we remove the bean definition. Let's retest and verify.

sobychacko commented 5 years ago

Since there is no EnableAutoConfiguration on ServerController, I believe it is required to redefine the controller bean in ScheamaServerConfiguation. cc/ @olegz Since it is working the way it is defined right now, I am closing this issue.

olegz commented 5 years ago

Actually the problem is that at the moment one can no longer start SchemaRegistryServerApplication as it fails with override warning. I think the real issue is that ServerController is a @Component already, so bootstrapping it as a bean is meaningless and instead we should simply include it as @Import