Integration of JavaScript and JMS [closed]

2019-01-24 19:38发布

Where can I find a guide for integrating JavaScript and JMS (Java Messaging Service)?

I would like a best practice or established technology that allows me to directly or indirectly receive messages from a topic and update a site based on the message. I was thinking of creating two components, a servlet for the Web module, and an MDB (Message-Driven Bean) for the EJB module. The web client will comsume messages from the JMS topic, and the MDB will handle the onMessage.

Does this sound correct? Have you seen any examples?

Edit: I am using ActiveMQ for the JMS.

4条回答
做自己的国王
2楼-- · 2019-01-24 20:16

I think this is your answer. Looks like it is baked in to ActieMQ. I tried the examples and they seem to work.

http://activemq.apache.org/ajax.html

查看更多
Emotional °昔
3楼-- · 2019-01-24 20:35

You'll find some references to the Dojo/Bayeux approach here
http://www.pathf.com/blogs/2006/08/bayeux_a_json_p/

If you're using WebSphere 6.0 or higher then the Web 2.0 Feature Pack includes an implementation.

查看更多
Root(大扎)
4楼-- · 2019-01-24 20:36

I would try using DWR to integrate JavaScript with your Java app. It makes Java to JavaScript communication transparent and only requires one servlet + configuration of what to expose. I haven´t done this with JMS, but it should work the same. There are three technologies that together solve all my integration problems, Spring, Mule, and DWR.

查看更多
倾城 Initia
5楼-- · 2019-01-24 20:38

The Seam framework supports subscription to JMS topics from a JavaScript based client:

http://docs.jboss.com/seam/2.0.2.GA/reference/en-US/html/remoting.html#d0e14169

查看更多
登录 后发表回答