Skip to content

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

Open
@spring-operator

Description

@spring-operator

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:

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions