Commit 2e019b52a63b15e035a199914b28363eae857c70

Authored by Andrew Shvayka
1 parent d9023482

TB-73: Implementation

... ... @@ -174,15 +174,16 @@ class RuleActorMessageProcessor extends ComponentMsgProcessor<RuleId> {
174 174 context.parent().tell(new RuleToPluginMsgWrapper(pluginTenantId, pluginId, tenantId, entityId, ruleToPluginMsg), context.self());
175 175 if (action.isOneWayAction()) {
176 176 pushToNextRule(context, msg.getCtx(), RuleEngineError.NO_TWO_WAY_ACTIONS);
  177 + return;
177 178 } else {
178 179 pendingMsgMap.put(ruleToPluginMsg.getUid(), msg);
179 180 scheduleMsgWithDelay(context, new RuleToPluginTimeoutMsg(ruleToPluginMsg.getUid()), systemContext.getPluginProcessingTimeout());
  181 + return;
180 182 }
181 183 }
182   - } else {
183   - logger.debug("[{}] Nothing to send to plugin: {}", entityId, pluginId);
184   - pushToNextRule(context, msg.getCtx(), RuleEngineError.NO_TWO_WAY_ACTIONS);
185 184 }
  185 + logger.debug("[{}] Nothing to send to plugin: {}", entityId, pluginId);
  186 + pushToNextRule(context, msg.getCtx(), RuleEngineError.NO_TWO_WAY_ACTIONS);
186 187 }
187 188
188 189 void onPluginMsg(ActorContext context, PluginToRuleMsg<?> msg) {
... ... @@ -215,13 +216,13 @@ class RuleActorMessageProcessor extends ComponentMsgProcessor<RuleId> {
215 216 ctx = ctx.withError(error);
216 217 }
217 218 if (ctx.isFailure()) {
218   - logger.debug("[{}] Forwarding processing chain to device actor due to failure.", ctx.getInMsg().getDeviceId());
  219 + logger.debug("[{}][{}] Forwarding processing chain to device actor due to failure.", ruleMd.getId(), ctx.getInMsg().getDeviceId());
219 220 ctx.getDeviceActor().tell(new RulesProcessedMsg(ctx), ActorRef.noSender());
220 221 } else if (!ctx.hasNext()) {
221   - logger.debug("[{}] Forwarding processing chain to device actor due to end of chain.", ctx.getInMsg().getDeviceId());
  222 + logger.debug("[{}][{}] Forwarding processing chain to device actor due to end of chain.", ruleMd.getId(), ctx.getInMsg().getDeviceId());
222 223 ctx.getDeviceActor().tell(new RulesProcessedMsg(ctx), ActorRef.noSender());
223 224 } else {
224   - logger.debug("[{}] Forwarding processing chain to next rule actor.", ctx.getInMsg().getDeviceId());
  225 + logger.debug("[{}][{}] Forwarding processing chain to next rule actor.", ruleMd.getId(), ctx.getInMsg().getDeviceId());
225 226 ChainProcessingContext nextTask = ctx.getNext();
226 227 nextTask.getCurrentActor().tell(new RuleProcessingMsg(nextTask), context.self());
227 228 }
... ...
... ... @@ -25,7 +25,7 @@
25 25 </encoder>
26 26 </appender>
27 27
28   - <logger name="org.thingsboard.server" level="INFO" />
  28 + <logger name="org.thingsboard.server" level="TRACE" />
29 29 <logger name="akka" level="INFO" />
30 30
31 31 <root level="INFO">
... ...
... ... @@ -125,10 +125,10 @@ public class AlarmProcessor implements RuleProcessor<AlarmProcessorConfiguration
125 125 Alarm alarm = buildAlarm(ctx, msg);
126 126 existing = ctx.createOrUpdateAlarm(alarm);
127 127 if (existing.getStartTs() == alarm.getStartTs()) {
128   - log.debug("[{}][{}] New Active Alarm detected");
  128 + log.debug("[{}][{}] New Active Alarm detected", ctx.getRuleId(), existing.getId());
129 129 md.put(IS_NEW_ALARM, Boolean.TRUE);
130 130 } else {
131   - log.debug("[{}][{}] Existing Active Alarm detected");
  131 + log.debug("[{}][{}] Existing Active Alarm detected", ctx.getRuleId(), existing.getId());
132 132 md.put(IS_EXISTING_ALARM, Boolean.TRUE);
133 133 }
134 134 } else if (isClearedAlarm) {
... ...