Commit 3a38ed8d6a7ee0bbed745cc67f01b3de5c3fc9b4
Committed by
Andrew Shvayka
1 parent
5d30243e
Fix for copy msg for 2 or more relations
Showing
2 changed files
with
8 additions
and
3 deletions
@@ -56,6 +56,7 @@ import java.util.HashMap; | @@ -56,6 +56,7 @@ import java.util.HashMap; | ||
56 | import java.util.List; | 56 | import java.util.List; |
57 | import java.util.Map; | 57 | import java.util.Map; |
58 | import java.util.Set; | 58 | import java.util.Set; |
59 | +import java.util.UUID; | ||
59 | import java.util.stream.Collectors; | 60 | import java.util.stream.Collectors; |
60 | 61 | ||
61 | /** | 62 | /** |
@@ -291,7 +292,7 @@ public class RuleChainActorMessageProcessor extends ComponentMsgProcessor<RuleCh | @@ -291,7 +292,7 @@ public class RuleChainActorMessageProcessor extends ComponentMsgProcessor<RuleCh | ||
291 | putToQueue(tpi, msg.copyWithRuleNodeId(entityId, new RuleNodeId(target.getId())), callbackWrapper); | 292 | putToQueue(tpi, msg.copyWithRuleNodeId(entityId, new RuleNodeId(target.getId())), callbackWrapper); |
292 | break; | 293 | break; |
293 | case RULE_CHAIN: | 294 | case RULE_CHAIN: |
294 | - putToQueue(tpi, msg.copyWithRuleChainId(new RuleChainId(target.getId())), callbackWrapper); | 295 | + putToQueue(tpi, msg.copyWithRuleChainId(new RuleChainId(target.getId()), UUID.randomUUID()), callbackWrapper); |
295 | break; | 296 | break; |
296 | } | 297 | } |
297 | } | 298 | } |
@@ -195,11 +195,15 @@ public final class TbMsg implements Serializable { | @@ -195,11 +195,15 @@ public final class TbMsg implements Serializable { | ||
195 | } | 195 | } |
196 | 196 | ||
197 | public TbMsg copyWithRuleChainId(RuleChainId ruleChainId) { | 197 | public TbMsg copyWithRuleChainId(RuleChainId ruleChainId) { |
198 | - return new TbMsg(this.queueName, this.id, this.ts, this.type, this.originator, this.metaData, this.dataType, this.data, ruleChainId, null, this.ruleNodeExecCounter.get(), callback); | 198 | + return copyWithRuleChainId(ruleChainId, this.id); |
199 | + } | ||
200 | + | ||
201 | + public TbMsg copyWithRuleChainId(RuleChainId ruleChainId, UUID msgId) { | ||
202 | + return new TbMsg(this.queueName, msgId, this.ts, this.type, this.originator, this.metaData, this.dataType, this.data, ruleChainId, null, this.ruleNodeExecCounter.get(), callback); | ||
199 | } | 203 | } |
200 | 204 | ||
201 | public TbMsg copyWithRuleNodeId(RuleChainId ruleChainId, RuleNodeId ruleNodeId) { | 205 | public TbMsg copyWithRuleNodeId(RuleChainId ruleChainId, RuleNodeId ruleNodeId) { |
202 | - return new TbMsg(this.queueName, this.id, this.ts, this.type, this.originator, this.metaData, this.dataType, this.data, ruleChainId, ruleNodeId, this.ruleNodeExecCounter.get(), callback); | 206 | + return new TbMsg(this.queueName, UUID.randomUUID(), this.ts, this.type, this.originator, this.metaData, this.dataType, this.data, ruleChainId, ruleNodeId, this.ruleNodeExecCounter.get(), callback); |
203 | } | 207 | } |
204 | 208 | ||
205 | public TbMsgCallback getCallback() { | 209 | public TbMsgCallback getCallback() { |