[infinispan-dev] Hotrod 5.3.0.Beta1

Mark Addy maddy at c2b2.co.uk
Thu May 16 13:27:10 EDT 2013


Hi,

Doesn't work for me out of the box, here are the steps to reproduce:

I downloaded infinispan-5.3.0.Beta1-all.zip, extracted and started 
hotrod with this command:

./startServer.sh -r hotrod --port=11111 --host=0.0.0.0 
--cache_config=/opt/temp-infinispan/infinispan-5.3.0.Beta1-all/etc/config-samples/distributed-udp.xml 


My client has these properties on the classpath:

infinispan.client.hotrod.transport_factory = 
org.infinispan.client.hotrod.impl.transport.tcp.TcpTransportFactory
infinispan.client.hotrod.server_list = 0.0.0.0:11111
infinispan.client.hotrod.marshaller = 
org.infinispan.marshall.jboss.GenericJBossMarshaller
infinispan.client.hotrod.async_executor_factory = 
org.infinispan.client.hotrod.impl.async.DefaultAsyncExecutorFactory
infinispan.client.hotrod.default_executor_factory.pool_size = 1
infinispan.client.hotrod.default_executor_factory.queue_size = 10000
infinispan.client.hotrod.hash_function_impl.1 = 
org.infinispan.client.hotrod.impl.consistenthash.ConsistentHashV1
infinispan.client.hotrod.tcp_no_delay = true
infinispan.client.hotrod.ping_on_startup = true
infinispan.client.hotrod.request_balancing_strategy = 
org.infinispan.client.hotrod.impl.transport.tcp.RoundRobinBalancingStrategy
infinispan.client.hotrod.key_size_estimate = 64
infinispan.client.hotrod.value_size_estimate = 512
infinispan.client.hotrod.force_return_values = true
maxActive=-1
maxTotal = -1
maxIdle = -1
whenExhaustedAction = 1
timeBetweenEvictionRunsMillis=120000
minEvictableIdleTimeMillis=300000
testWhileIdle = true
minIdle = 1

And runs the following test:

public class HotrodClient {
     public static void main(String[] args) throws Exception {
         RemoteCacheManager remoteCacheManager = new RemoteCacheManager();
         RemoteCache<String, String> myCache = 
remoteCacheManager.getCache();
         myCache.put("key", "test");
         System.out.println("get " + myCache.get("key"));
     }
}

Which fails to find the key:

2013-05-16 18:22:36,952 TRACE [RemoteCacheImpl] (main) For key(key) 
returning null
get null

Thanks

Mark



Thanks for the replies, all sorted now.  I went back through the
previous archives and found ISPN-2281 and the changes associated to this.
So to get Hotrod working you must supply a custom Equivalence
implementation as an attribute of the dataContainer element for the cache.
I have created a wrapper around the enum
org.infinispan.util.ByteArrayEquivalence and placed it on the server
classpath so I could use it in the XML configuration.

>> ^ The thing is that you shouldn't need to do this. If you've downloaded the new Infinsispan server download from (http://downloads.jboss.org/infinispan/5.3.0.Beta1/infinispan-server-5.3.0.Beta1-bin.zip), it ships a default configuration that has this setting correctly set. (@Tristan, correct me if I'm wrong...)
> You are right Galder.
>> Hence, if you can explain how you're using the Hot Rod server, we can see if there's anything wrong here.
> Tristan
>
>



More information about the infinispan-dev mailing list