'Websocket api at backend using java

Using Java I need to create a websocket connection with UI that just renders data to clients , at Java backend should I use some library or raw socket present in javax package is sufficient? Use case: I have metrics being generated in my application and need to pass the metrics every 2seconds to some UI component using web socket



Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source