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
Improve HttpClientProtocol robustness
Rich Turnera8003bc3292f
diff --git a/agent/src/main/java/org/openremote/agent/protocol/http/HttpClientProtocol.java b/agent/src/main/java/org/openremote/agent/protocol/http/HttpClientProtocol.javaindex a862e7a56..71037eb94 100644--- a/agent/src/main/java/org/openremote/agent/protocol/http/HttpClientProtocol.java+++ b/agent/src/main/java/org/openremote/agent/protocol/http/HttpClientProtocol.java@@ -1122,13 +1122,17 @@ public class HttpClientProtocol extends AbstractProtocol {LOG.fine("Scheduling polling request '" + clientRequest + "' to execute every " + pollingMillis + " ms for attribute: " + attributeRef);return executorService.scheduleWithFixedDelay(() ->- executePollingRequest(clientRequest, body, response ->+ executePollingRequest(clientRequest, body, response -> {+ try {onPollingResponse(- clientRequest,- response,- attributeRef,- protocolConfigurationRef)- ), 0, pollingMillis, TimeUnit.MILLISECONDS);+ clientRequest,+ response,+ attributeRef,+ protocolConfigurationRef);+ } catch (Exception e) {+ LOG.log(Level.WARNING, getProtocolDisplayName() + " exception thrown whilst processing polling response [" + (e.getCause() != null ? e.getCause().getMessage() : e.getMessage()) + "]: " + clientRequest.requestTarget.getUriBuilder().build().toString());+ }+ }), 0, pollingMillis, TimeUnit.MILLISECONDS);}protected void executePollingRequest(HttpClientRequest clientRequest, String body, Consumer<Response> responseConsumer) {