7 Replies Latest reply on Mar 11, 2007 1:03 AM by ben.wang

    PojoCacheListener does not propagate in a cluster

    mvlior

      Hi,

      We're using 2.0.0ALPHA2 in a standalone app.
      We have a PojoCache to which we add a PojoCacheListener, in attempt to log POJO deletions originating anywhere in the cluster.

      It seems that the listener gets called back when POJOs are acted upon on the local cache, but not when they are acted upon from other members of the cluster.

      There seems to be an open issue for this http://jira.jboss.com/jira/browse/JBCACHE-742 - can a correction to this be used already ?

      If that's problematic, is there a way we can make it work by ourselves (by adding an advice/aspect or altering code) ?


      Thanks,

      Lior Neuman
      R&D Team
      MailVision LTD.

        • 1. Re: PojoCacheListener does not propagate in a cluster
          manik

          Is this only with pojocache? Do you still have the problem with the vanilla cache as well?

          • 2. Re: PojoCacheListener does not propagate in a cluster

            Yes, the PojoCache listener is only acting in local mode. We are still invetigating a good way to map this into remote notification.

            • 3. Re: PojoCacheListener does not propagate in a cluster
              mvlior

              Hi,

              Thanks for your replies.


              What are our alternatives here ?



              Lior Neuman
              R&D Team
              MailVision LTD.

              • 4. Re: PojoCacheListener does not propagate in a cluster
                mvlior

                Hi,

                We depend on receiving the notification for deletion...

                Correct me if I'm wrong, but theoretically, since the deletion is replicated to all members of the cluster, then every member knows when something is deleted, and adding a notification should be possible.

                We have little use of the cache without notification, and are willing to work on making progress on this important issue.

                Can you please provide us with a way of achieving that, or at least guide us in our attempt to help ourselves ?


                Thank you,
                Lior Neuman
                R&D Team,
                MailVision LTD.

                • 5. Re: PojoCacheListener does not propagate in a cluster

                  Sorry to reply late. The change in 2.0 is we use aop interceptor to fire the pojo event, instead of relying on the old Cache event for node deletion and creation, etc. So we need to come up with a way to replicate this to the remote nodes.

                  A temp workaround may be for you to intercept all the nodes events yourself and determine that your pojo id node has been deleted or added and fire up the events from there. Please note that any node fqn other than __JBossInternal__ is considered your pojo node. So it is deterministics.

                  Will this help?

                  • 6. Re: PojoCacheListener does not propagate in a cluster
                    mvlior

                    Thank you for replying.

                    We have viewed the AOP intoruction webinar and found NotificationInterceptor.java, but since we are not part of the development community in JBoss, we still lack the know-how.
                    Where would you suggest that we begin learning the details ? Any example or resource would be appreciated.

                    Also, if that's not too much to ask, can you please pinpoint the classes that need to be intercepted ?


                    Thank you,
                    Lior Neuman
                    R&D Team,
                    MailVision LTD.

                    • 7. Re: PojoCacheListener does not propagate in a cluster

                      So first thing of course is to download the cvs source for head. After that, you will junit test example under tests/functiona/org/jboss/cache/pojo/event for the LocaTest, e.g.

                      For my previous recommendation, I'd think just to subscribe to the CacheListener events and track from there by yourself.