需求: 最近在对接一个物联网里设备,他的通信方式是 websocket 。所以我需要在 springboot框架中集成websocket 依赖,从而实现与设备实时通信! 框架:springboot2.7 java版本:java8 好了,还是直接上代码 第一步:引入依赖 <dependency> <groupId>org.springframework.boot</groupId> <artifactId>spring-boot-starter-websocket</artifactId> </dependency> 第二步写配置: package com.agentai.base.config; import com.agentai.base.yumou.webSocket.YuMouDeviceWebSocketHandler; import org.springframework.context.annotation.Bean; import org.springframework.context.annotation.Configuration; import...
Import Org.springframework.web.socket.config.annotation.enable WebSocket
As seen in:
cnblogs.com,
CSDN
Is this you? As a journalist, you can create a free Muck Rack account to customize your profile, list your contact preferences, and upload a portfolio of your best work.
Claim your profile
Get in touch with Import Org.springframework.web.socket.config.annotation.enable
Contact Import Org.springframework.web.socket.config.annotation.enable, search articles and posts on X, monitor coverage, and track replies from one place.
Learn more about Muck Rack