This is an automated email from the ASF dual-hosted git repository.
riemer pushed a commit to branch dev
in repository https://gitbox.apache.org/repos/asf/streampipes.git
The following commit(s) were added to refs/heads/dev by this push:
new ed8788a4df fix: Fix timeout in OI4 adapter
ed8788a4df is described below
commit ed8788a4df871838fa08fff438e9323c80e7a212
Author: Dominik Riemer <[email protected]>
AuthorDate: Fri May 10 10:57:07 2024 +0200
fix: Fix timeout in OI4 adapter
---
.../apache/streampipes/connect/iiot/adapters/oi4/Oi4Adapter.java | 7 ++-----
1 file changed, 2 insertions(+), 5 deletions(-)
diff --git
a/streampipes-extensions/streampipes-connect-adapters-iiot/src/main/java/org/apache/streampipes/connect/iiot/adapters/oi4/Oi4Adapter.java
b/streampipes-extensions/streampipes-connect-adapters-iiot/src/main/java/org/apache/streampipes/connect/iiot/adapters/oi4/Oi4Adapter.java
index 52d0b41fc1..06bd974c6c 100644
---
a/streampipes-extensions/streampipes-connect-adapters-iiot/src/main/java/org/apache/streampipes/connect/iiot/adapters/oi4/Oi4Adapter.java
+++
b/streampipes-extensions/streampipes-connect-adapters-iiot/src/main/java/org/apache/streampipes/connect/iiot/adapters/oi4/Oi4Adapter.java
@@ -272,7 +272,7 @@ public class Oi4Adapter implements StreamPipesAdapter {
thread.setUncaughtExceptionHandler((t, e) ->
exceptionRef.set(e.getCause()));
thread.start();
- while (sampleMessages.isEmpty() && exceptionRef.get() == null &&
timeElapsed < ReceiveSchemaSleepTime) {
+ while (sampleMessages.isEmpty() && exceptionRef.get() == null &&
timeElapsed < ReceiveSchemaMaxTimeout) {
try {
TimeUnit.MILLISECONDS.sleep(ReceiveSchemaSleepTime);
timeElapsed += ReceiveSchemaSleepTime;
@@ -338,15 +338,12 @@ public class Oi4Adapter implements StreamPipesAdapter {
// an empty list of selected sensors means that we want to collect
data from all sensors available
if (selectedSensors.isEmpty() || selectedSensors.contains(sensorId))
{
-
return extractAndEnrichMessagePayload(dataMessage, sensorId);
}
- } else {
- throw new ParseException(String.format("No sensor of type %s found
in message", givenSensorType));
}
}
}
- throw new ParseException("No process data message");
+ throw new ParseException(String.format("No sensor of type %s found in
message", givenSensorType));
}
private List<DataSetMessage> findProcessDataInputMessage(NetworkMessage
message) {