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:
http://assets.spring.io/wp/WebSocketBlogPost.html
Here is a link to the complete webinar. It also talks about plugging in
a full featured message broker like ActiveMQ.
http://youtube.com/watch?v=mmIza3L64Ic
Here is a link to the sample application using STOMP over Websockets
support. It uses Jetty or Tomcat.
https://github.com/rstoyanchev/spring-websocket-portfolio
I hope those pointers help a little. :)
Best regards,
Thomas
Am 11.04.2014 18:23, schrieb Xu, Anqing:
Hi,
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:
_https://blogs.oracle.com/brunoborges/entry/integrating_websockets_and_jms_with_.
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
[email protected]
https://dev.eclipse.org/mailman/listinfo/jetty-users
_______________________________________________
jetty-users mailing list
[email protected]
https://dev.eclipse.org/mailman/listinfo/jetty-users