简体   繁体   中英

Can we use WebSocket sink, in Spring cloud stream app starters, as WebSocket source?

Can I use the WebSocket sink available in Spring Cloud Stream App Starters as WebSocket Source. So that when I start the source the clients can send messages to the source as there is a websocket server listening on a specific port.

The existing sink for websocket won't work as a source out of the box. The sink receives the data from a middleware and send that to the sink. In the case of a source, its the other way around, ie it receives messages from a websocket endpoint and sends that to the middleware. The option at this point is to provide a custom websocket source from your side until a formal websocket-source is available. If you go with this route, please consider contributing that back to spring-cloud-stream-app-starters . Spring Integration has excellent coverage for web sockets . You can use that as a starter.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM