Adds routing keys in message headers

If the incoming message has a stream_routekey header, we use that
to route the message to a named function. Also adding the header
to messages coming out of suppliers.

The biggest change here is sort of orthogonal: it fixes a bug where
Spring Integration would subscribe twice to the same input channel
if the FunctionCatalog contains both functions and consumers. Then
when a message comes in it is dispatched to one or the other, but not
both. So the routing key couldn't work without fixing that
problem.
This commit is contained in:
Dave Syer
2017-07-11 17:03:39 +01:00
parent 4b30721d02
commit 7e966c73ca
8 changed files with 176 additions and 30 deletions

View File

@@ -262,6 +262,9 @@ public class ContextFunctionCatalogAutoConfiguration {
else if (target instanceof Function) {
registration.target(target((Function<?, ?>) target, key));
}
for (String name : registration.getNames()) {
beans.put(name, key);
}
this.registrations.put(registration.getTarget(), key);
}