Home Help Center

Publisher and Subscriber

slypeteslypete Member Pete SylvesterOrganization: Coconaut StudiosProject: iPhone/iPod Game ✭✭
I'm building an IceStorm app where every Ice object is both a publisher and subscriber to a topic.

Is there a way to stop the subscriber from receiving the events published from the same object?

I could be going about this totally wrong because I just started working with Ice.

Thanks,
Pete

Comments

  • matthewmatthew NL, CanadaMember Matthew NewhookOrganization: ZeroC, Inc.Project: Internet Communications Engine ✭✭✭
    There is currently no way to do that. This would be a form of event filtering, a feature which is quite common to event publishing systems. If you are interested in sponsoring the addition of such a feature to IceStorm please contact [email protected].

    Without event filtering one way to do what you want is to put some piece of metadata in the event context -- such as the sender object id. In the subscriber you then look at the data, and throw out the event if the object-id matches your own object id.
  • slypeteslypete Member Pete SylvesterOrganization: Coconaut StudiosProject: iPhone/iPod Game ✭✭
    I wish I could sponsor it. I'm just a poor college kid though, haha. Sorry guys.

    I knew that I could just do it on the application side, but I wanted to avoid that expensive operation all together. If the publisher and subscriber reside in the same app, is Ice smart enough to not send the data over the network and instead use the loopback or some other means?

    This event filtering functionality will be necessary for the application we're building. Do you see this coming anytime in the near future?

    Thanks,
    Pete
  • matthewmatthew NL, CanadaMember Matthew NewhookOrganization: ZeroC, Inc.Project: Internet Communications Engine ✭✭✭
    I knew that I could just do it on the application side, but I wanted to avoid that expensive operation all together. If the publisher and subscriber reside in the same app, is Ice smart enough to not send the data over the network and instead use the loopback or some other means?

    Ice does have collocation optimization, by which calls on "local" Ice objects (that is, Ice objects hosted by the same communicator as the proxy used to call on the Ice object) are directly dispatched, instead of first marshaled, sent over the wire, read and dispatched. However, in this case the collocation optimization cannot be applied since you are sending through an another service (in this case, IceStorm).
    This event filtering functionality will be necessary for the application we're building. Do you see this coming anytime in the near future?

    Without a sponsor, event filtering will not be added in the near future.
  • slypeteslypete Member Pete SylvesterOrganization: Coconaut StudiosProject: iPhone/iPod Game ✭✭
    matthew wrote: »
    Without a sponsor, event filtering will not be added in the near future.

    If we decide to use IceStorm for our event channel needs, we will be implementing our own event filtering system to IceStorm. If you'd like to sponsor this and a promising medical project, feel free to contact me at [email protected].

    Pete
  • hughwarhughwar Member Warren HughesOrganization: Synthetic Equity Trading (DB)Project: ETF MM
    Application is a publisher and subscriber to a topic(s)

    Hi ZeroC Staff /Pete,

    I have just started using Ice/IceStorm yesterday and am a total middleware novice. I'm looking to build a working prototype system where by every process is both a publisher and a subscriber, possibly on different topics.

    I am using C# and have tried to get this approach working but am not having much luck.

    both my subscriber and publisher classes make use of the same slice output file and inherit from Ice.Application and reside within the same namespace. Further i 'new' these objects from within their own threads from the application main but Im not getting the results I expect.

    Is there a preferred or known way to organize the classes that inherit from Ice.Application so they can both publish and subscribe, or is there an alternative mechanism/technique that can be used?

    Thanks very much
    Warren
  • xdmxdm La Coruña, SpainAdministrators, ZeroC Staff Jose Gutierrez de la ConchaOrganization: ZeroC, Inc.Project: Ice Developer ZeroC Staff
    Hi Warren,

    Ice.Application is a convenient class for creating Ice applications, in resume it takes care of initialize Ice runtime when the application start and cleanup it when the application finish, you can get more details of Ice.Application in Ice manual, note that Ice.Application does not affect to your subscriber or publiser roll with IceStorm, being a publisher or a subscriber is only a matter of use the convenient IceStorm mechanism, You should read IceStorm chapter of Ice manual and look IceStorm demos to check the details.

    If after revise these materials you still have problems with use IceStorm, you can ask here your concrete problem and we will happy to help you.

    Note that for use IceStorm you don´t need to use Ice.Application but most of the time you want to use it as it simplified the task of initialize the Ice runtime, but you still could initialize/cleanup the runtime in your code if that is more convenient for your concrete use case.

    Regards,
    José
Sign In or Register to comment.