Topic Connection track from dashboard page

classic Classic list List threaded Threaded
2 messages Options
Reply | Threaded
Open this post in threaded view
|

Topic Connection track from dashboard page

pandharinath.barve
CONTENTS DELETED
The author has deleted this message.
Reply | Threaded
Open this post in threaded view
|

Re: Topic Connection track from dashboard page

Mike Wilson
Administrator
Do you really want to set up a separate JMS connection for every browser tab
using your application? That sounds bad for scaling.

Normally you would set up one shared JMS connection on your server, send
each message once into DWR, and then let DWR take care of keeping track of
connected browsers and distributing each message to all connected browsers.
Have a look at the Reverse Ajax Clock example:
https://svn.directwebremoting.org/dwr/trunk/ui/dwr/demo/java/com/example/dwr
/reverseajax/Clock.java
and the Browser API.
http://directwebremoting.org/dwr/documentation/reverse-ajax/hints-and-tips.h
tml#browserAPI

Best regards
Mike Wilson

pandharinath.barve wrote:

> [mailto:[hidden email]]
> Sent: den 30 mars 2015 15:03
> To: [hidden email]
> Subject: [dwr-users] Topic Connection track from dashboard page
>
> I am trying to develop dashboard application which will recive data
> from Topic/s.  I am using DWR reverse-ajax functionality for
> the same.
>
> // index.html
>
> window.onload = function(){
>      // other code here
>      MessageUpdater.open();
> }
>
> window.onbeforeunload = function() {
>
>     MessageUpdater.close();
>
> };
>
> // MessageUpdater.java
>
> // Setup JMS and create a subscriber listener
>  
>  public void open() throws JMSException {
>
>     // creating connection code to Topic  and opening connection
>      Connection.start();
>
>  }
>
>  public synchronized void close() {
>     // closing the topic connection and other resources
>      Connection.close();
>  }
>
>
>  Could you please let me know how to keep track of all connections.
> Suppose if opened three dashboard pages then 3 non-durable connections
> will be opened
>  to Topic. Now I want to close one dashboard , then how to close the
> exact connection created by this dashboard page to Topic.  Is
> there any
> API in DWR library to handle this
>
>   Thanks in advance.