-
Notifications
You must be signed in to change notification settings - Fork 77
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
Feature/property binding for docket configuration #123
Feature/property binding for docket configuration #123
Conversation
…ithout the need to write code Co-authored-by: Timon Back <[email protected]>
…gle the possibility to produce on configured kafka instances Co-authored-by: Timon Back <[email protected]>
Co-authored-by: Timon Back <[email protected]>
Co-authored-by: Timon Back <[email protected]>
Use prefix in springwolf kafka plugin Add test for springwolf kafka plugin producer configuration switch Co-authored-by: Timon Back <[email protected]>
…f wie spring properties Set AMQP producer functionality to disabled as the new default Co-authored-by: Timon Back <[email protected]>
… application Co-authored-by: Timon Back <[email protected]>
…n and SpringWolfConfigProperties By default, the user-defined AsyncApiDocket is used. The application.properties are a fall-back, and possible recommended way in the future. Otherwise, an exception is thrown. Co-authored-by: sam0r040 <[email protected]>
Co-authored-by: sam0r040 <[email protected]>
Bean injection will only work, if the user defined a custom bean and it does not work, when the application.properties configuration is used. Co-authored-by: sam0r040 <[email protected]>
Co-authored-by: sam0r040 <[email protected]>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Great job, I really like this improvement.
I have no comments, just one question. I saw that you added annotationProcessor 'org.springframework.boot:spring-boot-configuration-processor'
to the gradle files - why?
implementation 'org.springframework:spring-web' | ||
implementation 'org.springframework.amqp:spring-rabbit' | ||
|
||
implementation 'com.google.guava:guava:31.1-jre' | ||
|
||
compileOnly 'org.projectlombok:lombok:1.18.4' | ||
annotationProcessor 'org.projectlombok:lombok:1.18.4' | ||
annotationProcessor 'org.springframework.boot:spring-boot-configuration-processor' |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why is this needed?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The annotation processor will create metadata files that can be used by IDEs to support code completion when work with spring configuration. This way users are not "blind" when they try to write spring configuration but get contextual help. I'm not sure how many IDEs support it, but Intellij has good support for it. This is what it looks like in Intellij for the sprinwolf-kafka-example project:
You can find the documentation here: https://docs.spring.io/spring-boot/docs/current/reference/html/configuration-metadata.html#appendix.configuration-metadata.annotation-processor
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Very cool, I didn't know that
Springwolf AsyncApiDocket meta data can now be configured without manually creating a bean of AsyncApiDocket. All metadata can by provided with spring application porperties.
Together with #118 (Annotation for publisher and subscriber), it should now be possible to use springwolf without creating a AsyncApiDocket bean at all. Instead annotations and spring application properties can be used.
As a part of the change to use spring properties, a property to disable the producer functionality has been introduced to the kafka and amqp plugins. Although it is a breaking change, we decided to disable the producer functionality by default, because we see the functionality is potentially dangerous for users who are unaware of the feature and want to use springwolf in a production environment.
There is also another property to disable springwolf by spring configuration in springwolf core to support use cases where springwolf should be enabled on some deployment environments, although it should be disabled on others.