Archived

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

Can subscriber be activated by publisher on demand?

hi,
I have a program that subscribe a topic "Demo/Hello" and configure with activation = "on-demand" in IceGrid , can it be activated by publisher?

And how can i detect the connection broken between the IceStorm and the Subscriber ? with periodic calls to ice_ping may be a solution , but I don't think that is a good idea :)

Comments

  • Yes. Any remote procedure call will activate the server if the server is registered for on-demand activation, no matter where the call originates from.

    Detecting connection loss always requries some form of polling. This is because, in general, TCP/IP does not inform the reader/writer of connection loss unless there is some activity for the connection, that is, someone is trying to read or write to/from the connection. For example, if the wire is physically broken at some point along the chain, you don't find out until you try to read from or write to the connection.

    Cheers,

    Michi.
  • dwayne
    dwayne St. John's, Newfoundland
    michi wrote: »
    Yes. Any remote procedure call will activate the server if the server is registered for on-demand activation, no matter where the call originates from.

    Note that this will only work for an IceStorm subscriber if the subscriber had previously subscribed to the topic and then exited without unsubscribing. Any further published events will then cause the subscriber to restart and receive the message. If the subsciber unsubscribes when it exits or has never subscribed then it will not get activated by subsequent events since IceStorm will have no knowledge of the subscriber.
  • thanks
    dwayne wrote: »
    Note that this will only work for an IceStorm subscriber if the subscriber had previously subscribed to the topic and then exited without unsubscribing.


    It is hard to meet above requirements! :)

    ps . Persistent subscribers is a solution?
  • matthew
    matthew NL, Canada
    The best solution is persistent subscribers, yes. Another solution would be to send heartbeat messages through IceStorm... if you don't get the heartbeat message then you know something has gone wrong.