NPE fix in DefaultTbContext

This commit is contained in:
Andrii Shvaika 2022-05-30 12:16:30 +03:00
parent c0f64c836e
commit f0d887b91a

View File

@ -169,7 +169,9 @@ class DefaultTbContext implements TbContext {
private void enqueue(TopicPartitionInfo tpi, TbMsg tbMsg, Consumer<Throwable> onFailure, Runnable onSuccess) {
if (!tbMsg.isValid()) {
log.trace("[{}] Skip invalid message: {}", getTenantId(), tbMsg);
if (onFailure != null) {
onFailure.accept(new IllegalArgumentException("Source message is no longer valid!"));
}
return;
}
TransportProtos.ToRuleEngineMsg msg = TransportProtos.ToRuleEngineMsg.newBuilder()
@ -242,7 +244,9 @@ class DefaultTbContext implements TbContext {
private void enqueueForTellNext(TopicPartitionInfo tpi, String queueName, TbMsg source, Set<String> relationTypes, String failureMessage, Runnable onSuccess, Consumer<Throwable> onFailure) {
if (!source.isValid()) {
log.trace("[{}] Skip invalid message: {}", getTenantId(), source);
if (onFailure != null) {
onFailure.accept(new IllegalArgumentException("Source message is no longer valid!"));
}
return;
}
RuleChainId ruleChainId = nodeCtx.getSelf().getRuleChainId();