diff --git a/streampipes-extensions/streampipes-connect-adapters-iiot/src/main/java/org/apache/streampipes/connect/iiot/adapters/iolink/IfmAlMqttAdapter.java b/streampipes-extensions/streampipes-connect-adapters-iiot/src/main/java/org/apache/streampipes/connect/iiot/adapters/iolink/IfmAlMqttAdapter.java index e2606996d9..af9dad2b9c 100644 --- a/streampipes-extensions/streampipes-connect-adapters-iiot/src/main/java/org/apache/streampipes/connect/iiot/adapters/iolink/IfmAlMqttAdapter.java +++ b/streampipes-extensions/streampipes-connect-adapters-iiot/src/main/java/org/apache/streampipes/connect/iiot/adapters/iolink/IfmAlMqttAdapter.java @@ -110,18 +110,26 @@ public void onAdapterStarted(IAdapterParameterExtractor extractor, for (int i = 0; i < ports.size(); i++) { - var portResult = getMap(payload, - "/iolinkmaster/port[%s]/iolinkdevice/pdin".formatted(ports.get(i))); - var eventData = (String) portResult.get("data"); - - var parsedEvent = sensor.parseEvent(eventData); - parsedEvent.put("timestamp", System.currentTimeMillis() + i); - parsedEvent.put("port", "port" + ports.get(i)); - parsedEvent.put(SensorVVB001.IO_LINK_MASTER_SN, serialnumber); - - collector.collect(parsedEvent); + try { + var portResult = getMap(payload, + "/iolinkmaster/port[%s]/iolinkdevice/pdin".formatted(ports.get(i))); + var eventData = (String) portResult.get("data"); + + var parsedEvent = sensor.parseEvent(eventData); + parsedEvent.put("timestamp", System.currentTimeMillis() + i); + parsedEvent.put("port", "port" + ports.get(i)); + parsedEvent.put(SensorVVB001.IO_LINK_MASTER_SN, serialnumber); + + collector.collect(parsedEvent); + } catch (Exception e) { + adapterRuntimeContext + .getLogger() + .error(e); + LOG.error("Data from IOLink sensor could not be extracted for port {}: {}", i, e); + } } - }); + } + ); } catch (Exception e) { adapterRuntimeContext .getLogger()