<div dir="ltr">Hi,<div><br></div><div>This is now done and is available to see here: <a href="https://github.com/spaulg/infinispan-cachestore-redis">https://github.com/spaulg/infinispan-cachestore-redis</a>. I used the remote store within the infinispan repo as a base of reference.</div><div><br></div><div>There are some points that my be worth further discussion. They are:</div><div>1. the cache loader size method return type is limited to int. Redis servers can hold much more than Integer.MAX_VALUE and the Jedis client method for counting items on the Redis server returns longs for each server, which in addition must be totalled up for each server if using a Redis cluster topology. To get around this I am checking for a long over Integer.MAX_VALUE and logging a warn, then returning Integer.MAX_VALUE.</div><div>2. Redis handles expiration. I am using lifespan to immediately set the expiration of the cache entry in Redis, and when that lifespan is reached the item is immediately purged by Redis itself. This means, there is no idle time, and there is no purge method implementation.</div><div>3. A few unit tests around expiration had to be disabled as they require changes to time. As expiration is handled by Redis, I would have to change the system time to make Redis force expiration. For now, they are just disabled.</div><div><br></div><div>I have built it against the Jedis client. I also tried 2 other clients, lettuce and redisson, but felt that Jedis gave the best implementation as a) it didn't try to do too much (by this I mean running background monitoring threads that try to detect failure and perform automatic failover of Redis slaves) and b) had all the API features I needed to make the implementation work efficiently.</div><div><br></div><div>Jedis supports 3 main modes of operation. They are, single server, Redis sentinel and Redis cluster. Redis versions that should be supported are 2.8+ and 3.0+.</div><div><br></div><div>I haven't tested this beyond the unit tests distributed with Infinispan which are starting full Redis servers in single server, sentinel and cluster configurations to run the tests, but I am hoping to start working on getting integration in to Wildfly 10, which I can test with a cache container for web sessions and a simple counter web app.</div><div><br></div><div>Regards</div><div>Simon</div></div><div class="gmail_extra"><br><div class="gmail_quote">On 31 July 2015 at 09:01, Tristan Tarrant <span dir="ltr"><<a href="mailto:ttarrant@redhat.com" target="_blank">ttarrant@redhat.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">Let's start with a separate repo to begin with. As for third party<br>
clients, choose the one you feel is the best.<br>
<br>
Thanks for looking into this<br>
<br>
Tristan<br>
<span class=""><br>
On 29/07/2015 20:31, Simon Paulger wrote:<br>
> Hi Tristan,<br>
><br>
> With regards to project repositories, should I add the code to a fork of<br>
> the main infinispan project or create a standalone repository as per<br>
> hbase, jdbm, etc?<br>
><br>
> And I presume there's no objections to using a third party Redis client?<br>
> I was thinking Jedis (<a href="https://github.com/xetorthio/jedis" rel="noreferrer" target="_blank">https://github.com/xetorthio/jedis</a> - MIT license,<br>
> currently maintained).<br>
><br>
> Thanks,<br>
> Simon<br>
><br>
> On 29 July 2015 at 10:47, Tristan Tarrant <<a href="mailto:ttarrant@redhat.com">ttarrant@redhat.com</a><br>
</span><span class="">> <mailto:<a href="mailto:ttarrant@redhat.com">ttarrant@redhat.com</a>>> wrote:<br>
><br>
> Yes, we would be very interested. Check out the Infinispan cachestore<br>
> archetype [1] to get things started, and ask here or on IRC on<br>
> #infinispan for help, if you need more information.<br>
><br>
><br>
> Tristan<br>
><br>
> [1] <a href="https://github.com/infinispan/infinispan-cachestore-archetype" rel="noreferrer" target="_blank">https://github.com/infinispan/infinispan-cachestore-archetype</a><br>
><br>
> On 28/07/2015 22:43, Simon Paulger wrote:<br>
> > Hi,<br>
> ><br>
> > I'm interested in developing inifinispan integration with Redis<br>
> for use<br>
> > in JBoss. Before working on JBoss, I first need to add the<br>
> capability to<br>
> > Infinispan itself.<br>
> ><br>
> > Is this an enhancement that the infinispan community would be<br>
> interested in?<br>
> ><br>
> > Regards,<br>
> > Simon<br>
> ><br>
> ><br>
> > _______________________________________________<br>
> > infinispan-dev mailing list<br>
> > <a href="mailto:infinispan-dev@lists.jboss.org">infinispan-dev@lists.jboss.org</a><br>
</span>> <mailto:<a href="mailto:infinispan-dev@lists.jboss.org">infinispan-dev@lists.jboss.org</a>><br>
<span class="">> > <a href="https://lists.jboss.org/mailman/listinfo/infinispan-dev" rel="noreferrer" target="_blank">https://lists.jboss.org/mailman/listinfo/infinispan-dev</a><br>
> ><br>
><br>
> --<br>
> Tristan Tarrant<br>
> Infinispan Lead<br>
> JBoss, a division of Red Hat<br>
> _______________________________________________<br>
> infinispan-dev mailing list<br>
</span>> <a href="mailto:infinispan-dev@lists.jboss.org">infinispan-dev@lists.jboss.org</a> <mailto:<a href="mailto:infinispan-dev@lists.jboss.org">infinispan-dev@lists.jboss.org</a>><br>
> <a href="https://lists.jboss.org/mailman/listinfo/infinispan-dev" rel="noreferrer" target="_blank">https://lists.jboss.org/mailman/listinfo/infinispan-dev</a><br>
<div class="HOEnZb"><div class="h5">><br>
><br>
><br>
><br>
> _______________________________________________<br>
> infinispan-dev mailing list<br>
> <a href="mailto:infinispan-dev@lists.jboss.org">infinispan-dev@lists.jboss.org</a><br>
> <a href="https://lists.jboss.org/mailman/listinfo/infinispan-dev" rel="noreferrer" target="_blank">https://lists.jboss.org/mailman/listinfo/infinispan-dev</a><br>
><br>
<br>
--<br>
Tristan Tarrant<br>
Infinispan Lead<br>
JBoss, a division of Red Hat<br>
_______________________________________________<br>
infinispan-dev mailing list<br>
<a href="mailto:infinispan-dev@lists.jboss.org">infinispan-dev@lists.jboss.org</a><br>
<a href="https://lists.jboss.org/mailman/listinfo/infinispan-dev" rel="noreferrer" target="_blank">https://lists.jboss.org/mailman/listinfo/infinispan-dev</a><br>
</div></div></blockquote></div><br></div>