spring-projects / spring-projects/spring-integration
Any multi-channel router should support channel name patterns [INT-1189]
Nobody has claimed this yet.
- Dominant language
- Java
- Stars
- 1.6k
- Forks
- 1.2k
- Avg merge
- 17h 48m
- Merged PRs (30d)
- 62
Description
Mark Fisher opened INT-1189 and commented
Currently, the multi-channel routers are required to return 0 or more channel instances or channel names. This is typically done by returning an array or Collection (or having an equivalent type of evaluation result from a SpEL expression).
We should also add support for basic wildcard matching (e.g. "bank.prime.*" would match any channel whose name begins with "bank.prime.").
The most elegant solution is probably to change the ChannelResolver strategy interface so that it supports a multi-return value option. The only method currently defined on the interface is:
MessageChannel resolveChannelName(String channelName);
We could add:
Collection<MessageChannel> resolveChannelPattern(String channelPattern);
The question is of course if we need to worry about backwards compatibility. It would be much nicer to have a single interface rather than having to extend ChannelResolver (which inevitably leads to instanceof checks). My initial feeling is that implementing ChannelResolver is a rather advanced extension. In fact, I'd be surprised if more than a handful of SI users have ever done it. Those users would probably be the least concerned if we add a method to the interface.
Affects: 2.0 M4
Issue Links:
- #5375 Refactor router hierarchy to provide consistent approach for managing router mappings dynamically (e.g., ControlBus)
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start with the ChannelResolver interface and the multi-channel router implementations described in the issue. Review linked issue #5375 and assess the proposed pattern-resolution API, backwards-compatibility impact, and how completion would be verified across affected routers.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- java, spring
- Domain
- backend, distributed-systems
- Issue type
- Feature
- Difficulty
- 5/5
- Estimated time
- Over a week
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 25/100