Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
Re: [jetty-users] Integrating ActiveMQ with Jetty 9.1 for websocket support

Hi Anqing,

I'm playing with that idea as well.
If you are fine with pulling in the Spring Framework as a dependency, a lot of the work is already done for you.

It uses the JSR 356 API which Jetty implements and allows you to route the STOMP messages to your own broker.
It also implements a SockJS Server which provides fallbacks for browsers that don't implement websockets, e.g. long polling. This happens transparently to you.

Here is a high level overview of what Spring provides:

Here is a link to the complete webinar. It also talks about plugging in a full featured message broker like ActiveMQ.

Here is a link to the sample application using STOMP over Websockets support. It uses Jetty or Tomcat.

I hope those pointers help a little. :)

Best regards,

Am 11.04.2014 18:23, schrieb Xu, Anqing:

I am exploring various technologies in order to build a real-time web application.  My current thinking is to use Jetty 9.1 as the app server and embedded ActiveMQ as the messaging broker.  I want to take advantage of the JSR-356 websocket support in Jetty 9 with STOMP as the sub-protocol.  But I've also noticed that ActiveMQ supports websocket + STOMP as a transport.  I'm wondering how these two work together.  I've heard that ActiveMQ's own websocket is based on Jetty Continuation but does it work with Jetty 9.1?  How do I embed ActiveMQ in Jetty 9.1 with websocket support?

One approach is to forget about ActiveMQ's own websocket transport support and just write websocket handler within Jetty. Essentially I use Jetty to handle all the transport related work.  I then write glue code to relay the message to ActiveMQ destinations.  Vice Versa.  See this nice example:

But then I have to mess around with STOMP messages and doing a lot of glue coding.  If I can use ActiveMQ's websocket support directly without doing all these, it will save me a lot of trouble.

How about Tomcat 8, which also has JSR-356 websocket support?   can I embed ActiveMQ within Tomcat 8 and expect to get websocket transport support?

I will greatly appreciate any insight into this.  Thanks!

jetty-users mailing list

Back to the top