-
Notifications
You must be signed in to change notification settings - Fork 1.1k
Extract BaseIntegrationFlowDefinition
#3087
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
Extract BaseIntegrationFlowDefinition
#3087
Conversation
|
I am ok with this generally, but I think it means new builds of all downstream (extension) projects will be needed to work with this version. |
|
I would take such a risk since the simple workaround is just to compile the project against this version. Otherwise we would have to deffer Kotlin DSL feature until the next year... |
|
Actually, it's a lot worse than that; any user app that uses the methods in IFD has to be recompiled... @Bean
public IntegrationFlow inFlow(ConsumerFactory<String, String> consumerFactory) {
ContainerProperties props = new ContainerProperties("ktest23");
props.setGroupId("ktest23int");
return IntegrationFlows.from(Kafka.messageDrivenChannelAdapter(consumerFactory, props))
.handle(msg -> System.out.println("int:" + msg.getPayload()))
.get(); |
Kotlin inline reified functions cannot override as syntax sugar generic Java methods. * Extract a `BaseIntegrationFlowDefinition` with strong typed methods, plus those which doesn't have a syntax sugar variants * Leave in the `IntegrationFlowDefinition` only those generic methods which are just a syntax sugar without any types requirements This way we can write Kotlin inline reified functions as an extension with the same names to make a Kotlin DSL much cleaner
…atibility * Extract `protected` getters and setters for `BaseIntegrationFlowDefinition` properties to allow a proper extension * Use those getters and setters in the code
ff49456 to
9faaa3b
Compare
|
Here is a solution we discussed with you yesterday. Unfortunately another one with a plain extension still doesn't work in Kotlin. Do not merge yet this one, since I haven't finished Kotlin part to be sure that we are good. Thanks |
BaseIntegrationFlowDefinitionBaseIntegrationFlowDefinition
| } | ||
|
|
||
|
|
||
| // All the methods below override super for bytecode backward compatibility. |
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.
I think we will need to mark all these with NOSONAR to avoid "useless override" smells from Sonar 😦
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.
Correct, but I would like to see that message to be sure about the place for such a // NOSONAR comment
BaseIntegrationFlowDefinitionBaseIntegrationFlowDefinition
|
OK! Missed Thanks |
|
And now you can see what happened to Kotlin DSL after this. |
|
It goes on the method after the |
|
Thanks. Done. |
Kotlin inline reified functions cannot override as syntax sugar generic
Java methods.
BaseIntegrationFlowDefinitionwith strong typed methods,plus those which doesn't have a syntax sugar variants
IntegrationFlowDefinitiononly those generic methodswhich are just a syntax sugar without any types requirements
This way we can write Kotlin inline reified functions as an extension
with the same names to make a Kotlin DSL much cleaner