3 Replies Latest reply on Mar 6, 2014 3:26 AM by tadayosi

    Can I use ClusteredInvoker in a standalone client?

    tadayosi

      Hello,

       

      I'm playing with clustered SwitchYard servers and wondering if a clustered SwitchYard service (i.e. a service having a SCA service binding with 'clustered' = true) can be invoked from a standalone client in a load-balanced manner.

       

      I'm aware that RemoteInvoker has two implementation classes, HttpInvoker and ClusteredInvoker, and using ClusteredInvoker seems to do the work. However, ClusteredInvoker needs a RemoteRegistry instance to be instantiated. How can we get the RemoteRegistry instance to instantiate ClusteredInvoker?

       

      Thanks,

      Tadayoshi

        • 1. Re: Can I use ClusteredInvoker in a standalone client?
          kcbabo
          1 of 1 people found this helpful
          • 2. Re: Can I use ClusteredInvoker in a standalone client?
            tadayosi

            Hi Keith,

             

            Thank you for your answer. I've been trying to create an instance of InfinispanRegistry but so far couldn't do so, as the InfinispanRegistry constructor requires Infinispan's Cache instance but I'm not sure how to get the instance.

             

            If I understand your intent correctly, in order to get a Cache instance we need to first launch DefaultCacheManager locally in the standalone application and let it join the Infinispan clustering group for the SwitchYard servers so that the same copy of cache SwitchYard servers have is loaded and accessible locally. Is that approach what you meant?

             

            I haven't succeeded in this approach so far; The launched DefaultCacheManager somehow doesn't join the SwitchYard's cluster group. Maybe my JGroups configuration is wrong but I don't know where the problem is.

             

            I've attached my project (cluster.zip), so could you please have a look at it and if possible show me the correct configuration?

             

            Thanks,

            Tadayoshi

            • 3. Re: Can I use ClusteredInvoker in a standalone client?
              tadayosi

              I finally reached the conclusion that the current ClusteredInvoker API does in fact not allow us to use it outside of a SwitchYard server, or if it's possible at all, it's pretty hard or limited.

               

              Firstly, it looks quite difficult to make a standalone Java client join the Infinispan cluster group for SwitchYard servers, and even if it's possible, it shouldn't be a good design that short-lived, temporary standalone Java clients join and leave the cluster group so frequently. There is also a critical limitation that all the members of the Infinispan cluster group must be in the same subnet mask, so this approach is only appricable to the clients in the same subnet mask.

               

              Considering all these, I think it's impractical to use ClusteredInvoker outside of a SwitchYard server. Just in case, I'll file a RFE to deal with this limitation later on.

               

              For now, the preferred approach to invoke a SY service in a load-balanced manner seems to be using HttpInvoker with an external load-balancer such as mod_jk or mod_cluster. Please let me know if there are any pitfalls in this alternative approach. Thanks.