
com.zhuang.mica.mqtt.client.MqttClientService Maven / Gradle / Ivy
The newest version!
package com.zhuang.mica.mqtt.client;
import com.zhuang.mica.mqtt.service.BaseMqttService;
import lombok.extern.slf4j.Slf4j;
import net.dreamlu.iot.mqtt.codec.MqttQoS;
import net.dreamlu.iot.mqtt.spring.client.MqttClientTemplate;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
@Slf4j
//@Service
public class MqttClientService extends BaseMqttService {
@Autowired(required = false)
private MqttClientTemplate mqttClientTemplate;
@Override
protected boolean publish(String topic, byte[] payload, MqttQoS qos, boolean retain) {
return mqttClientTemplate.publish(topic, payload, qos, retain);
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy