3 Replies Latest reply on Jul 11, 2011 6:11 AM by pmuir

    Configuration.setNumOwners(1) and notification listeners

    susanin

      Hi,

       

      I'm wondering if CacheEntryModified and other entry-related notifications are sent to listeners registered at non-owner nodes, in case where setNumOwners(1) is used, i.e. each entry has only a single owner?

       

      I'm using Infinispan 4.2.0 FINAL and it looks like no such notifications are sent. Is it the expected behavior?

       

      Are there any other ways to have an observer of a given cache on a remote node? This observer should get all notifications about any changes of the cache state on a remote machine, but it should not maintain its own copy of the entries.

      Specifically, I'm interested in reducing the amount of data excahnged between both nodes and reducing memory usage on the observer node. What would be the best way to achieve this?

        • 1. Re: Configuration.setNumOwners(1) and notification listeners
          pmuir

          Events are only sent to owner nodes.

           

          If you want to propagate the events to non owner nodes, you would need to use a messaging solution such as HornetQ

          • 2. Re: Configuration.setNumOwners(1) and notification listeners
            susanin

            Hi,

             

            Thanks for the tip about HornetQ!

            But as I mentioned in another thread on this forum, I'm trying to get rid of additional overhead and architectural complexity introduced systems like JMS or HornetQ.

             

            In this sense, Hazelcast provides a very handy set of APIs for subscribing and listening to events related to any distributed data structure (e.g. maps, queues, lists, etc). Any node or a super-client (i.e. node that does not keep a copy of the data) can subscribe to such changes and receive them. It does not matter if they own the node or not.

             

            Would be nice, if Infinispan could do the same. After all, there is no additional overhead, if there are no subscribers to these udpates.

            • 3. Re: Configuration.setNumOwners(1) and notification listeners
              pmuir

              This has been discussed in another thread, but if you want such a set of data structures, please open feature requests in JIRA so that we can track them.