Skip to content
Snippets Groups Projects
Commit 4bf44b72 authored by FrankR's avatar FrankR
Browse files

SensorValueIntegration rejects all mqttMessages while IPos-FW is not yet initialized

parent c4853d64
No related branches found
No related tags found
No related merge requests found
...@@ -29,6 +29,7 @@ public class MainApp { ...@@ -29,6 +29,7 @@ public class MainApp {
// SimpleSceneIntegration.init(); // SimpleSceneIntegration.init();
SimpleSceneIntegration.init(INDUSTRIEROBOTIK_FILE); SimpleSceneIntegration.init(INDUSTRIEROBOTIK_FILE);
// SimpleSceneIntegration.init(SENSORDATENFUSION_FILE); // SimpleSceneIntegration.init(SENSORDATENFUSION_FILE);
ipos.project.SensorValueIntegration.api.MqttPositionHandler.setInitialized(true);
// GenericSensorValueProcessor.processTestData(TESTDATA_EMPTY); // GenericSensorValueProcessor.processTestData(TESTDATA_EMPTY);
// SimpleSceneIntegration.handleMessageFile(TESTDATA_EMPTY); // SimpleSceneIntegration.handleMessageFile(TESTDATA_EMPTY);
} }
......
...@@ -35,12 +35,21 @@ public class MqttPositionHandler implements Handler { ...@@ -35,12 +35,21 @@ public class MqttPositionHandler implements Handler {
this.jmsTemplate = jmsTemplate; this.jmsTemplate = jmsTemplate;
} }
static boolean iposFrameworkIsInitialized = false;
public static void setInitialized(boolean b) {
iposFrameworkIsInitialized = b;
}
// @Autowired // @Autowired
// private ExternalPubServiceImpl mqttService; // private ExternalPubServiceImpl mqttService;
// method that handle new message from the topic // method that handle new message from the topic
public void handle(MqttMessage message) { public void handle(MqttMessage message) {
try { try {
if (! iposFrameworkIsInitialized){
return;
}
SensorEventWrapper protoSensEventWrapper = ProtoJsonMap.fromJson(message.toString(), GenericSensor.SensorEventWrapper.class); SensorEventWrapper protoSensEventWrapper = ProtoJsonMap.fromJson(message.toString(), GenericSensor.SensorEventWrapper.class);
handleSensorEventWrapper(protoSensEventWrapper); handleSensorEventWrapper(protoSensEventWrapper);
} catch (InvalidProtocolBufferException e) { } catch (InvalidProtocolBufferException e) {
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment