0

I have Dynamic Web Application deployed on Glassfish server. Inside my application I have a java function that is invoked every time certain JMS Message is received. Depending on JMS Message, I want to update the state of web application that is loaded inside web browser - I need to call certain Javascript function as soon as the JMS Message is received.

How can i accomplish that? Is there any java and/or Javscript library that can do this?

Any help will be greatly appreciated, thank you.

P.S. After Some research i have found a very useful library that does exactly what i wanted: DWR - Direct Web Remoting

Tornike Shavishvili
  • 988
  • 4
  • 13
  • 30
  • 2
    you want to "push" data to browser? [websockets](https://developer.mozilla.org/en-US/docs/Web/API/WebSockets_API) perhaps? or [Server Sent Events](https://developer.mozilla.org/en-US/docs/Web/API/Server-sent_events) look more up your alley – Jaromanda X Aug 11 '17 at 06:29

1 Answers1

1

Old way: by polling at a certain interval

New way: by using websockets,

http://vertx.io/ provides a good library to achieve this.

You can see sample here http://vertx.io/blog/real-time-bidding-with-websockets-and-vert-x/

Ali786
  • 4,211
  • 6
  • 34
  • 54