diff --git a/api-customer/app.py b/api-customer/app.py index 2bcf070a..ba5880e7 100644 --- a/api-customer/app.py +++ b/api-customer/app.py @@ -23,13 +23,15 @@ if __name__ == '__main__': local_broker = MQTTService( local_broker_address, local_broker_port, - username="pi-1", + client_id="customer-api", + username="main", password="hepl", ) api_broker = MQTTService( api_broker_address, api_broker_port, + client_id="customer-api", username="customer", password="hepl", ) diff --git a/api/mosquitto/data/mosquitto.db b/api/mosquitto/data/mosquitto.db index 47c54a8c..717cfb4d 100644 Binary files a/api/mosquitto/data/mosquitto.db and b/api/mosquitto/data/mosquitto.db differ diff --git a/api/src/main/java/MqttStarter.java b/api/src/main/java/MqttStarter.java index bd7d93dc..3128a388 100644 --- a/api/src/main/java/MqttStarter.java +++ b/api/src/main/java/MqttStarter.java @@ -2,6 +2,7 @@ import be.naaturel.boardmateapi.common.helpers.Logger; import be.naaturel.boardmateapi.services.MqttService; import jakarta.annotation.PreDestroy; import org.springframework.boot.context.event.ApplicationReadyEvent; +import org.springframework.context.annotation.Bean; import org.springframework.context.event.EventListener; import org.springframework.stereotype.Component; @@ -16,7 +17,7 @@ public class MqttStarter { this.service = service; } - @EventListener(ApplicationReadyEvent.class) + @Bean public void start(){ try { setCallback();