4 Replies Latest reply on Feb 14, 2007 6:29 PM by javamann

    Distributed Hashtable and JGroups

      Hi all,
      I am trying to setup some separate JVM's to both use JGroups for inter-VM communications and to use a Distributed Hashtable. Is there a way to do this without using two Channels?

      Thanks

        • 1. Re: Distributed Hashtable and JGroups
          belaban

          You could use the Multiplexer, check the manual for details

          • 2. Re: Distributed Hashtable and JGroups

            I played around with the Multiplexer for an evening trying to get it to work with both a Distributed Hashtable and a 'Normal' Channel (using UDP) and could not get it going. I have no doubt it is something I was setting up wrong which is why I wanted to check with the group.

            Thanks

            • 3. Re: Distributed Hashtable and JGroups

              You can instantiate a multiplexer channel from a client as follows.

              STACK_FILE = "stacks.xml";
              STACK_NAME = "udp";

              JChannelFactory factory=new JChannelFactory();
              factory.setMultiplexerConfig(STACK_FILE);
              Channel channel = factory.createMultiplexerChannel(STACK_NAME, "foo");
              channel.connect("my group");

              STACK_FILE must be on your classpath; JGroups provides a file named stacks.xml in its distributable jar. You can use this file or create your own with customized stacks. STACK_NAME refers to the stack within STACK_FILE.

              • 4. Re: Distributed Hashtable and JGroups

                Using the demo code and the manual I had already got that part working. I also got the Distributed Hashtable working using a Multiplexer. I just couldn't get them both working.