5 Replies Latest reply on Jul 12, 2002 8:18 AM by Robert Caranica

    Clustered Rmi Service - How to ?

    Robert Caranica Newbie




      Hello,

      I have a number of question about clustered RMI services:

      1) The jboss docs say that failover and load balancing are available for RMI Services too. Is this transparent too ? I mean, using a jndi lookup for a RMI service will do ?

      Which brings me to the next question, which should be probably asked in another forum section, but I ask it here as it's related with the first one:

      2) How do I create and register an RMI service so that it is cluster(-able). The Jboss 3.0 Clustering Document I purchased rev 0.2 on 3 dec 2001 only elaborates on how to make EJBs clustered. There is however a section (1.G.II.d) on HA-RMI, but it's not clear to me if the code in that section has to be used to implement such a clustered RMI service. If so, where should it be put ? I mean the service has to be registered somehow, no ? And if the code has to be put somewhere, it means that clustering is not transparent, as the code is cluster-specific. (what to do if no cluster ? I mean for beans we have the tag, but what do we have for RMI services ?)

      I noticed a user-service.xml in the jboss deploy directory, but it allows definition of services that are MBeans. The RMI Service has to be a MBean in order to have clustering features ?

      Or can I "attach" somehow to the internal Jboss RMI Registry ?

      Any help is appreciated. Thanks!

      Robert

      PS: Jboss seems to be a great piece of software, Open Source is the way... unfortunately the lack of docs/howtos limits the developer base. I mean what good are all the internal features if no external users know about them or how to use them. Looking in the source should not be the only way to find out about nice things. This is merely the frustration in me speaking, but I think there's some truth in what it's saying ;)


        • 1. Re: Clustered Rmi Service - How to ?
          Robert Caranica Newbie



          Ok. I've investigated the problem a little further, as I got no replies on the forum :(

          So far this is how one can get a RMI service clustered:

          The code in the section (1.G.II.d) on HA-RMI, from the "Jboss 3.0 Clustering Document" has to be used. Unfortunately this point was not very explicit in that document and basically I had to try every solution that I could think of. The downside is that this code is very AS-specific, making clustering setup for RMI not transparent as opposed to clustering for EJBs, where we don't have to modify the code, but merely edit some deployment descriptors.

          Now, if you're not interested in clustering, but still want RMI, there are a number of solutions:

          1) The RMI service registers itself to JNDI via context.bind(). (when the cluster is setup, JDNI lookup failover is available though. Not sure how useful this is, but I've mentioned it anyway). Cleints access the service via JNDI.

          2) Do it the old fashioned way, with

          LocateRegistry.createRegistry();
          Registry registry = LocateRegistry.getRegistry();
          and then bind() the service to the registry.

          Client needs stub for jdk < 1.2 or can download it if the policy file permits this.

          Now, the problem is how to make the registry start when the server starts. One solution is from a servlet which is loaded on startup by jetty (inside jboss). Not an elegant solution, but at least it works. In my opinion a nicer way to do this should be made available to the user, although we tend to drop RMI in favor of EJBs and other stuff that uses RMI as transport. RMI must still be ready-to-use in a modern AS, along side "bleeding edge" technologies ;).

          Robert

          • 2. Re: Clustered Rmi Service - How to ?
            Robert Caranica Newbie



            Ok. I've investigated the problem a little further, as I got no replies on the forum :(

            So far this is how one can get a RMI service clustered:

            The code in the section (1.G.II.d) on HA-RMI, from the "Jboss 3.0 Clustering Document" has to be used. Unfortunately this point was not very explicit in that document and basically I had to try every solution that I could think of. The downside is that this code is very AS-specific, making clustering setup for RMI not transparent as opposed to clustering for EJBs, where we don't have to modify the code, but merely edit some deployment descriptors.

            Now, if you're not interested in clustering, but still want RMI, there are a number of solutions:

            1) The RMI service registers itself to JNDI via context.bind(). (when the cluster is setup, JDNI lookup failover is available though. Not sure how useful this is, but I've mentioned it anyway). Cleints access the service via JNDI.

            2) Do it the old fashioned way, with

            LocateRegistry.createRegistry();
            Registry registry = LocateRegistry.getRegistry();
            and then bind() the service to the registry.

            Client needs stub for jdk < 1.2 or can download it if the policy file permits this.

            Now, the problem is how to make the registry start when the server starts. One solution is from a servlet which is loaded on startup by jetty (inside jboss). Not an elegant solution, but at least it works. In my opinion a nicer way to do this should be made available to the user, although we tend to drop RMI in favor of EJBs and other stuff that uses RMI as transport. RMI must still be ready-to-use in a modern AS, along side "bleeding edge" technologies ;).

            Robert

            • 3. Re: Clustered Rmi Service - How to ?
              Robert Caranica Newbie


              Ok. I've investigated the problem a little further, as I got no replies on the forum :(

              So far this is how one can get a RMI service clustered:

              The code in the section (1.G.II.d) on HA-RMI, from the "Jboss 3.0 Clustering Document" has to be used. Unfortunately this point was not very explicit in that document and basically I had to try every solution that I could think of. The downside is that this code is very AS-specific, making clustering setup for RMI not transparent as opposed to clustering for EJBs, where we don't have to modify the code, but merely edit some deployment descriptors.

              Now, if you're not interested in clustering, but still want RMI, there are a number of solutions:

              1) The RMI service registers itself to JNDI via context.bind(). (when the cluster is setup, JDNI lookup failover is available though. Not sure how useful this is, but I've mentioned it anyway). Client access the service via JNDI.

              2) Do it the old fashioned way, with

              LocateRegistry.createRegistry();
              Registry registry = LocateRegistry.getRegistry();
              and then bind() the service to the registry.

              Client needs stub for jdk < 1.2 or it can download it if the policy file permits this.

              Now, the problem is how to make the registry start when the server starts. One solution is from a servlet which is loaded on startup by jetty (inside jboss). Not an elegant solution, but at least it works. In my opinion a nicer way to do this should be made available to the user, although we tend to drop RMI in favor of EJBs and other stuff that uses RMI as transport. RMI must still be ready-to-use in a modern AS, along side "bleeding edge" technologies ;).

              Robert

              • 4. Re: Clustered Rmi Service - How to ?
                Robert Caranica Newbie


                Ok. I've investigated the problem a little further, as I got no replies on the forum :(

                So far this is how one can get a RMI service clustered:

                The code in the section (1.G.II.d) on HA-RMI, from the "Jboss 3.0 Clustering Document" has to be used. Unfortunately this point was not very explicit in that document and basically I had to try every solution that I could think of. The downside is that this code is very AS-specific, making clustering setup for RMI not transparent as opposed to clustering for EJBs, where we don't have to modify the code, but merely edit some deployment descriptors.

                Now, if you're not interested in clustering, but still want RMI, there are a number of solutions:

                1) The RMI service registers itself to JNDI via context.bind(). (when the cluster is setup, JDNI lookup failover is available though. Not sure how useful this is, but I've mentioned it anyway). Client access the service via JNDI.

                2) Do it the old fashioned way, with

                LocateRegistry.createRegistry();
                Registry registry = LocateRegistry.getRegistry();
                and then bind() the service to the registry.

                Client needs stub for jdk < 1.2 or it can download it if the policy file permits this.

                Now, the problem is how to make the registry start when the server starts. One solution is from a servlet which is loaded on startup by jetty (inside jboss). Not an elegant solution, but at least it works. In my opinion a nicer way to do this should be made available to the user, although we tend to drop RMI in favor of EJBs and other stuff that uses RMI as transport. RMI must still be ready-to-use in a modern AS, along side "bleeding edge" technologies ;).

                Robert

                • 5. Re: Clustered Rmi Service - How to ?
                  Robert Caranica Newbie


                  Sorry for the 3 postings or so, but when I did it, the forum was having some kind of problems and although it said "Post OK", I couldn't see the post in the topic! Strange.. That's why I started another topic.