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:
@@ -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);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user