MqttClientCustomizerConfig.java
532 Bytes
package vion.config;
import net.dreamlu.iot.mqtt.spring.client.MqttClientCustomizer;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import java.util.concurrent.Executors;
/**
* mqtt客户端自定义配置
*/
@Configuration(proxyBeanMethods = false)
public class MqttClientCustomizerConfig {
@Bean
public MqttClientCustomizer mqttClientCustomizer() {
return creator -> creator.mqttExecutor(Executors.newVirtualThreadPerTaskExecutor());
}
}