Hope this works

This commit is contained in:
2025-12-29 19:58:43 +01:00
parent 2209490665
commit f44fb6f2ea
3 changed files with 5 additions and 2 deletions

View File

@@ -23,13 +23,15 @@ if __name__ == '__main__':
local_broker = MQTTService( local_broker = MQTTService(
local_broker_address, local_broker_address,
local_broker_port, local_broker_port,
username="pi-1", client_id="customer-api",
username="main",
password="hepl", password="hepl",
) )
api_broker = MQTTService( api_broker = MQTTService(
api_broker_address, api_broker_address,
api_broker_port, api_broker_port,
client_id="customer-api",
username="customer", username="customer",
password="hepl", password="hepl",
) )

Binary file not shown.

View File

@@ -2,6 +2,7 @@ import be.naaturel.boardmateapi.common.helpers.Logger;
import be.naaturel.boardmateapi.services.MqttService; import be.naaturel.boardmateapi.services.MqttService;
import jakarta.annotation.PreDestroy; import jakarta.annotation.PreDestroy;
import org.springframework.boot.context.event.ApplicationReadyEvent; import org.springframework.boot.context.event.ApplicationReadyEvent;
import org.springframework.context.annotation.Bean;
import org.springframework.context.event.EventListener; import org.springframework.context.event.EventListener;
import org.springframework.stereotype.Component; import org.springframework.stereotype.Component;
@@ -16,7 +17,7 @@ public class MqttStarter {
this.service = service; this.service = service;
} }
@EventListener(ApplicationReadyEvent.class) @Bean
public void start(){ public void start(){
try { try {
setCallback(); setCallback();