Home Help Center

Can subscriber be activated by publisher on demand?

dellobydelloby Member dellobyOrganization: BaosteelProject: Hotmill3
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

  • michimichi Member Michi HenningOrganization: Triodia TechnologiesProject: I have a passing interest in Ice :-) ✭✭✭
    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.
  • dwaynedwayne St. John's, NewfoundlandMember Dwayne BooneOrganization: ZeroC, Inc.Project: Internet Communications Engine
    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.
  • dellobydelloby Member dellobyOrganization: BaosteelProject: Hotmill3
    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?
  • matthewmatthew NL, CanadaMember Matthew NewhookOrganization: ZeroC, Inc.Project: Internet Communications Engine ✭✭✭
    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.
Sign In or Register to comment.