Tuesday 22 September 2009

Comet in GWT with StreamHub - New Release

A new version of the GWT Comet Adapter has been released for StreamHub Comet Server. The adapter is a GWT module which when included in your project allows you to stream real-time data from StreamHub to your GWT apps. Click the screenshot below to see a demo of the adapter in action:



In this latest release full failover and reconnection support has been added. Using the new connect method, its now possible to configure 100% of the failover and reconnection options available in StreamHub. For example:

StreamHubGWTAdapter streamhub = new StreamHubGWTAdapter();
List servers = new ArrayList();
servers.add("https://push1.stream-hub.com/");
servers.add("https://push2.stream-hub.com/");
servers.add("https://push3.stream-hub.com/");
FailoverParameters failoverParameters = new FailoverParameters(servers);
failoverParameters.setAlgorithm(FailoverAlgorithm.PRIORITY);
failoverParameters.setInitialReconnectDelayMillis(2000);
failoverParameters.setMaxReconnectDelayMillis(30000);
failoverParameters.setUseExponentialBackOff(true);
failoverParameters.setBackOffMultiplier(2.0);
failoverParameters.setMaxReconnectAttempts(20);
streamhub.connect(failoverParameters);

For full details of the API, you can browse the Javadoc online or checkout the projects homepage on Google Code.

2 comments:

  1. The method "streamhub.connect(failoverParameters)" doesn´t exist in version 1.0.2.Can you update this documentation? Thanks.

    ReplyDelete
  2. Hi, the failover connect method was introduced from 1.0.3 onwards. Suggest you download the latest version which is 1.0.4. Available here:

    http://gwt-comet-streamhub.googlecode.com/files/streamhub-gwt-adapter-1.0.4.jar

    Documentation:

    http://www.stream-hub.com/doc/streamhub-gwt-adapter/1.0.4/javadoc/

    ReplyDelete