Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Best Java framework for server side WebSockets [closed]

Tags:

java

websocket

I want to create simple server having low load. The goal is to give a few javascript clients access to some functionality implemented in Java through WebSockets. I seek for best library to use for that - it should be simple, robust etc. Now I consider 3 alternatives - jWebSocket - jetty - netty What is the best? Or may be something else?

Thanks in advance

like image 733
boqapt Avatar asked Oct 23 '10 08:10

boqapt


People also ask

Does spring boot support WebSocket?

Spring Boot includes the spring-WebSocket module, which is compatible with the Java WebSocket API standard (JSR-356). Implementing the WebSocket server-side with Spring Boot is not a very complex task and includes only a couple of steps, which we will walk through one by one.

What is STOMP Java?

STOMP. Stream Text-Oriented Messaging Protocol (STOMP) is a simple, interoperable wire format that allows client and servers to communicate with almost all the message brokers. It is an alternative to AMQP (Advanced Message Queuing Protocol) and JMS (Java Messaging Service).

How are WebSockets implemented in Java?

The WebSocket lifecycle annotations are mapped to Java methods. In this example, the @OnOpen annotation is mapped to the open() method; the @OnMessage annotation is mapped to the handleMessage() method; the @OnClose annotation to the close() method; and the @OnError annotation to the onError() method.

Which language is best for WebSockets?

A WebSocket server can be written in any server-side programming language that is capable of Berkeley sockets, such as C(++), Python, PHP, or server-side JavaScript.


2 Answers

I'd go with proven Java servlet servers: Jetty or Resin. The have both been extended to handle WebSockets:

Jetty WebSockets

Resin WebSockets

My personal choice would be Jetty, as it's very simple to use and I've been using it as embedded server in several projects.

There are also some new kids on the block like Atmosphere and jWebSocket, but for servers I prefer to go with a proven solution. Jetty and Resin are also generic Servlet servers, so you can go with one product for all your serving needs.

like image 106
Peter Knego Avatar answered Sep 20 '22 02:09

Peter Knego


jWebSocket now includes the Jetty 8.0 engine including SSL and includes many nice-to-haves on top of it. It provides cross-browser and cross-platform compatible clients even more mobile apps e.g. under Android, Symbian and BlackBerry. The server can easily be extended with plug-in and already includes lots of them (e.g. for Authentication/Autorization, JDBC, SMTP, XMPP/Jabber, RPC, Twitter, Filesharing, Chat etc.). Just check it out... http://jwebsocket.org. Looking forward to your feedback.

Regards Alex

like image 30
user502448 Avatar answered Sep 20 '22 02:09

user502448