I may be stupid
This commit is contained in:
@@ -1,9 +1,9 @@
|
|||||||
|
package be.naaturel.boardmateapi;
|
||||||
|
|
||||||
import be.naaturel.boardmateapi.common.helpers.Logger;
|
import be.naaturel.boardmateapi.common.helpers.Logger;
|
||||||
import be.naaturel.boardmateapi.services.MqttService;
|
import be.naaturel.boardmateapi.services.MqttService;
|
||||||
|
import jakarta.annotation.PostConstruct;
|
||||||
import jakarta.annotation.PreDestroy;
|
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;
|
import org.springframework.stereotype.Component;
|
||||||
|
|
||||||
import java.util.Arrays;
|
import java.util.Arrays;
|
||||||
@@ -17,9 +17,10 @@ public class MqttStarter {
|
|||||||
this.service = service;
|
this.service = service;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Bean
|
@PostConstruct
|
||||||
public void start(){
|
public void start(){
|
||||||
try {
|
try {
|
||||||
|
Logger.displayInfo("Broker initialized");
|
||||||
setCallback();
|
setCallback();
|
||||||
service.subscribe("/board-mate/+/telemetry");
|
service.subscribe("/board-mate/+/telemetry");
|
||||||
} catch (Exception e){
|
} catch (Exception e){
|
||||||
Reference in New Issue
Block a user