Archived

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

about Storm

there is a subscriber and a publisher,the publisher publishs message sometimes with topic "A" and sometimes with topic"B",I

want subscriber to receive both topics ,can a subscriber subscribe many topics?
BTW, I can definite the message which has a property to make out the two different messages,but it isn't my best choice.
Is there another way to do this?
Thank you!!

Comments

  • mes
    mes California
    Yes, a subscriber can subscribe to multiple topics. If you use the same servant for subscribing to both topics, then both topics must use the same interface definition (because a single servant cannot implement multiple unrelated interfaces).

    If the servant needs to know which topic a message came from, you could use a servant locator with a default servant, and then use different identities in the subscriber proxies that are given to the topic manager. The target identity is available to the servant via the Ice::Current parameter.

    Take care,
    - Mark
  • Thank you mes

    Is there something about this in the document? and do you have a demo?
    I can't understand what you said above since I havn't been familiar with ICE. what's the concept of "servant"? is it subscriber or the topicManager?
  • mes
    mes California
    When I said "servant" I was referring to the subscriber.

    Sorry, we don't have an example that demonstrates this. Once you get more familiar with Ice it won't be difficult to implement these ideas.

    - Mark
  • That's all right

    Thank you very much