springboot mqtt依赖
时间: 2023-11-14 21:08:07 浏览: 102
springboot整合rabbitmq转发mqtt
5星 · 资源好评率100%
要在Spring Boot项目中使用MQTT,需要添加以下依赖:
```xml
<dependency>
<groupId>org.springframework.integration</groupId>
<artifactId>spring-integration-mqtt</artifactId>
<version>5.3.2.RELEASE</version>
</dependency>
```
同时,还需要在application.properties或application.yml中配置MQTT连接信息,例如:
```yaml
spring:
mqtt:
url: tcp://localhost:1883
username: admin
password: admin
```
阅读全文