spring-projects / spring-projects/spring-integration

Any multi-channel router should support channel name patterns [INT-1189]

Open
#5,197 9 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

in: core type: enhancement
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

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. 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

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.