You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
AbstractRouterSpec.defaultOutputChannel takes both a channelName and a MessageChannel.
However, RouterSpec.channelMapping only takes a channelName, but not a MessageChannel.
When using the DSL, I try to avoid explicit channel names and prefer the IntegrationFlow.getInputChannel() method to look up the input channel for a flow.
Currently I must use "mySubflow.input" for the channelMapping but I can use defaultOutputChannel(mySubFlow().getInputChannel()) for the default.
The text was updated successfully, but these errors were encountered:
We can improve the RouterSpec to accept a MessageChannel as well, but you need to ensure that your channel is a NamedComponent over there. Since the target AbstractMappingMessageRouter expects from us only channel names.
As a workaround your can do something like this:
m -> m.channelMapping(true, ((NamedComponent) myFlow.getInputChannel()).getComponentName())
Feel free to raise a Pull Request with such an improvement.
We would need to check for NamedComponent in a new channelMapping() method before calling a delegate.
Fixesspring-projects#2754
For better end-user experience when we have `@Bean` declared for a
channel it is good to have a `MessageChannel` based
`RouterSpec.channelMapping` for possible traceability and code
navigation in the IDE
Fixes#2754
For better end-user experience when we have `@Bean` declared for a
channel it is good to have a `MessageChannel` based
`RouterSpec.channelMapping` for possible traceability and code
navigation in the IDE
Affects Version(s): 5.1.3
Enhancement
AbstractRouterSpec.defaultOutputChannel takes both a channelName and a MessageChannel.
However, RouterSpec.channelMapping only takes a channelName, but not a MessageChannel.
When using the DSL, I try to avoid explicit channel names and prefer the
IntegrationFlow.getInputChannel()
method to look up the input channel for a flow.Currently I must use "mySubflow.input" for the
channelMapping
but I can use defaultOutputChannel(mySubFlow().getInputChannel()) for the default.The text was updated successfully, but these errors were encountered: