100% open-source IoT Platform - Integrate your devices, add intelligence, build custom apps
Java asset-managementbuildingdashboarddataplatformdevice-managementedge-computingenergyenergy-managementenergy-monitorfleet-managementfleet-telematicsiotiot-applicationiot-platformmodbusmqttmqtt-brokerota-updaterules-enginesmartcity
Added try catch for updating value in simulator. Should schedule next update and log error
Michael Rademakeraaf9ac337bf0
diff --git a/agent/src/main/java/org/openremote/agent/protocol/simulator/SimulatorProtocol.java b/agent/src/main/java/org/openremote/agent/protocol/simulator/SimulatorProtocol.javaindex 724155cad..e8896626b 100644--- a/agent/src/main/java/org/openremote/agent/protocol/simulator/SimulatorProtocol.java+++ b/agent/src/main/java/org/openremote/agent/protocol/simulator/SimulatorProtocol.java@@ -565,8 +565,13 @@ public class SimulatorProtocol extends AbstractProtocol {return executorService.schedule(() -> {withLock(getProtocolName() + "::firingNextUpdate", () -> {LOG.info("Updating asset " + attributeRef.getEntityId() + " for attribute " + attributeRef.getAttributeName() + " with value " + nextDatapoint.value.toString());- updateLinkedAttribute(new AttributeState(attributeRef, nextDatapoint.value));- replayMap.put(attributeRef, scheduleReplay(attributeRef, replaySimulatorElement));+ try {+ updateLinkedAttribute(new AttributeState(attributeRef, nextDatapoint.value));+ } catch (Exception e) {+ LOG.log(Level.SEVERE, "Exception thrown when updating value: %s", e);+ } finally {+ replayMap.put(attributeRef, scheduleReplay(attributeRef, replaySimulatorElement));+ }});}, nextRunRelative, TimeUnit.SECONDS);} catch (JsonProcessingException e) {