package com.fuyuanshen.global.mqtt.publish;


import com.fuyuanshen.global.mqtt.config.MqttGateway;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

@Slf4j
@Service
public class MqttClientTest {
    @Autowired
    private MqttGateway mqttGateway;

    public void sendMsg() {
        mqttGateway.sendMsgToMqtt("worker/location/1", "hello mqtt spring boot");
        log.info("message is send");

        mqttGateway.sendMsgToMqtt("worker/alert/2", "hello mqtt spring boot2");
        log.info("message is send2");
    }
}