Browse Source

修改判断

master
yechuan 1 year ago
parent
commit
df13ca3d16
1 changed files with 15 additions and 13 deletions
  1. +15
    -13
      source/src/main/java/work/xuye/source/handler/SourceHandler.java

+ 15
- 13
source/src/main/java/work/xuye/source/handler/SourceHandler.java View File

@@ -124,19 +124,21 @@ public class SourceHandler {

Map<String, Message> nextNodeMessage = buildNextNodeMessage(result, task, message);

if (!ObjectUtils.isEmpty(nextNodeMessage)) {
nextNodeMessage.forEach((k, v) -> {
Set set = v.getHeaders().get(MessageConstants.OTHER_CACHE_KEY_SET, Set.class);
if (!ObjectUtils.isEmpty(set)) {
set.addAll(otherCacheKeySet);
v.getHeaders().put(MessageConstants.OTHER_CACHE_KEY_SET, set);
}
boolean send = streamBridge.send(k, v);
if (!send) {
throw new RuntimeException("send message failed");
}
});
}

nextNodeMessage.forEach((k, v) -> {
if (!ObjectUtils.isEmpty(otherCacheKeySet)) {
Set set = Objects.requireNonNullElse(v.getHeaders().get(MessageConstants.OTHER_CACHE_KEY_SET, Set.class), new HashSet());
set.addAll(otherCacheKeySet);
v = MessageBuilder
.fromMessage(v)
.setHeader(MessageConstants.OTHER_CACHE_KEY_SET, set)
.build();
}
boolean send = streamBridge.send(k, v);
if (!send) {
throw new RuntimeException("send message failed");
}
});
return null;
}



Loading…
Cancel
Save