I would like to stream realtime json data to a client via http/wss/socket or the like using netty. I can't seem to find any samples, examples or documentation that seems to even reference this type of functionality and how to implement it. Does it exist in netty?
How do I use betty bio to stream an endless number of json messages?
111 views Asked by crw1127 At
1
Maybe you could take a look at the examples within Netty as:
https://github.com/netty/netty/tree/4.1/example/src/main/java/io/netty/example/http/websocketx/server
https://github.com/netty/netty/tree/4.1/example/src/main/java/io/netty/example/http/upload
You can either inspire your code from the Json Codec (https://github.com/netty/netty/tree/4.1/codec/src/main/java/io/netty/handler/codec/json), or using the body part of the request (http) or the content of the websocket as a String to parse as a Json using your preferred Json parser.