1 Reply Latest reply on Mar 21, 2014 1:10 PM by Tristan Tarrant

    Implementing Memcached Server : Infinispan 6.0.x

    hello world Newbie

      Hello!

       

      I need to create a Maven project, in which I implement a distributed cluster respecting the architecture Client/Server.We have chosen as a Server Memcached.


      I've been the entire day trying to implement a Memcached Server using Infinispan 6.0.x. But I coudn't.


      The first problem is that the User Guide is outdated. This file <infinispan_directory>bin/startServer.bat  doesn't exist anymore, nor this directory : <infinispan_directory>modules\memcached. Why have you done this modification in the recent distributions?

       

      I've tried to get inspired from the Main class of org.infinispan.server.core, but it is in Scala. I found difficulties to translate it into Java code.

       

      So, could you please give me a link to a tutorial to be able to implement a Memcached Server based on Infinispan 6.0.x?

       

      A sample code in an answer would be appreciated as well.

       

      Thank you a lot!

      Farah

        • 1. Re: Implementing Memcached Server : Infinispan 6.0.x
          Tristan Tarrant Master

          The User Guide should be fixed in the 7.0 cycle. We removed startServer since we went to the AS-based standalone server.

           

          Here's some code to get you started:

           

          import org.infinispan.configuration.cache.ConfigurationBuilder;
          import org.infinispan.manager.DefaultCacheManager;
          import org.infinispan.server.memcached.MemcachedServer;
          import org.infinispan.server.memcached.configuration.MemcachedServerConfigurationBuilder;
          
          public class MyMemcachedServer {
          
            public static final void main(String args[]) {
                MemcachedServerConfigurationBuilder builder = new MemcachedServerConfigurationBuilder();
                builder.defaultCacheName("mycache");
                MemcachedServer server = new MemcachedServer();
                DefaultCacheManager cm = new DefaultCacheManager();
                cm.defineConfiguration("mycache", new ConfigurationBuilder().build());
                server.start(builder.build(), cm);
          
            }
          }
          
          

           

          As for Maven dependencies, just add org.infinispan:infinispan-server-memcached:6.0.2.Final

           

          Tristan