This forum has been archived. Please start a new discussion on GitHub.

Publish/Subscribe without IceStorm

Hi all,

I am gradually climbing the Ice learning curve (it's more of a pleasantly challenging walk, actually, thanks to the fine documentation), and I have some questions concerning the implementation of a publish/subscribe mechanism in terms of Ice primitives, without relying on IceStorm.

Suppose I have a server that can periodically serve, e.g., temperature sensor readouts. My current idea would be to define two interfaces, one for clients and one for servers, along these lines:
interface TemperatureClient {
    void newTemperature(double temperature);

interface TemperatureServer {
    void subscribe(TemperatureClient *);
    void unsubscribe(TemperatureClient *);

The first question is, if this is basically the correct approach. It would be helpful for me to hear from experienced Ice users if this is the case.

The second question is this: will the TemperatureServer need to do explicit management of subscribers (i.e., maintaining a collection of subscribers that is interested to get newTemperature() invocations), or is this in any way facilitated by Ice?

The last question is related to the second; if I need to do my own subscriber management, does this include the handling of ill behaving clients? What happens e.g. if a client goes down without an unsubscribe() call -- is there a "proper" way in which a server should handle this?

I realize that IceStorm addresses some of these issues, but for our application (that involves some high-volume data streams) we may need to avoid the single collect/distribute point of an IceStorm server.

Any thoughts on this would be greatly appreciated.

Best regards, Sidney


  • marc
    marc Florida
    I highly recommend to check out our Chat Demo and the corresponding articles, which explain subscription based application and session management and much more.
  • Will do! Thanks for the hint. I'll report back if I have any questions left ...