<div dir="ltr">Dude? How is this relevant to Keycloak? Try the WildFly mailing list.</div><div class="gmail_extra"><br><div class="gmail_quote">On 20 April 2016 at 09:37, Vlcko Rastislav <span dir="ltr"><<a href="mailto:vlcko.rastislav@scheidt-bachmann.sk" target="_blank">vlcko.rastislav@scheidt-bachmann.sk</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div lang="SK" link="blue" vlink="purple"><div><p class="MsoNormal"><span lang="EN-US">Hi,<u></u><u></u></span></p><p class="MsoNormal"><span lang="EN-US"><u></u> <u></u></span></p><p class="MsoNormal"><span lang="EN-US">I have the following problem. I am struggling with the configuration of the infinispan local cache. Especially with the configuration of "max-entries". In the previous version of Keycloak (1.7.0), the "max-entries" was doing exactly what I have expected - it was not possible to enter more entries than max-entries value. On the other hand, in the Keycloak 1.9.2 it seems that it is possible. At least with the configuration I have in the standalone.xml<u></u><u></u></span></p><p class="MsoNormal"><span lang="EN-US"><u></u> <u></u></span></p><p class="MsoNormal"><span style="font-size:10.0pt;font-family:"Courier New""><cache-container name="myCacheContainer"> <u></u><u></u></span></p><p class="MsoNormal"><span style="font-size:10.0pt;font-family:"Courier New""> <local-cache name="myCache"> <u></u><u></u></span></p><p class="MsoNormal"><span style="font-size:10.0pt;font-family:"Courier New""> <eviction strategy="LRU" max-entries="2"/> <u></u><u></u></span></p><p class="MsoNormal"><span style="font-size:10.0pt;font-family:"Courier New""> <expiration lifespan="600000"/> <u></u><u></u></span></p><p class="MsoNormal"><span style="font-size:10.0pt;font-family:"Courier New""> </local-cache> <u></u><u></u></span></p><p class="MsoNormal"><span style="font-size:10.0pt;font-family:"Courier New""></cache-container><u></u><u></u></span></p><p><span lang="EN-US" style="font-size:11.0pt;font-family:"Calibri","sans-serif"">My testing scenario is following: I have deployed my application to the Wildfly where the KC is running. In my app I was accessing instance of MyCache to add value to the cache using some REST endpoint. Then I was using another REST endpoint to display the content of MyCache. In the previous version of KC, I was able to add exactly 2 entries. Adding third one caused the first one to be replaced. In KC 1.9.2, the number of entries keeps growing like if there is no limit for it.<u></u><u></u></span></p><p><span lang="EN-US" style="font-size:11.0pt;font-family:"Calibri","sans-serif"">The way I am using the cache in code is pretty standard. Here is MyCache class:<u></u><u></u></span></p><pre><code>@ManagedBean <u></u><u></u></code></pre><pre><code>@Singleton <u></u><u></u></code></pre><pre><code>@Named("myCache") <u></u><u></u></code></pre><pre><code>public class MyCache implements IMyCache<String, String> { <u></u><u></u></code></pre><pre><code><u></u> <u></u></code></pre><pre><code> @Resource(lookup = "java:jboss/infinispan/container/myCacheContainer") <u></u><u></u></code></pre><pre><code> protected EmbeddedCacheManager container; <u></u><u></u></code></pre><pre><code> private Cache<String, String> cache; <u></u><u></u></code></pre><pre><code><u></u> <u></u></code></pre><pre><code> @PostConstruct <u></u><u></u></code></pre><pre><code> @Override <u></u><u></u></code></pre><pre><code> public void init() { <u></u><u></u></code></pre><pre><code> this.cache = container.getCache("myCache"); <u></u><u></u></code></pre><pre><code> } <u></u><u></u></code></pre><pre><code> ... <u></u><u></u></code></pre><pre><code>}<u></u><u></u></code></pre><pre><code><u></u> <u></u></code></pre><p class="MsoNormal"><span lang="EN-US">MyCache class is then injected to the class with REST resources where it is a part of some business logic.<u></u><u></u></span></p><p class="MsoNormal"><span lang="EN-US">I would appreciate any suggestions or hints how to fix this.<u></u><u></u></span></p><p class="MsoNormal"><span lang="EN-US"><u></u> <u></u></span></p><p class="MsoNormal"><span lang="EN-US">Thanks.<u></u><u></u></span></p><p class="MsoNormal"><u></u> <u></u></p></div></div><br>_______________________________________________<br>
keycloak-user mailing list<br>
<a href="mailto:keycloak-user@lists.jboss.org">keycloak-user@lists.jboss.org</a><br>
<a href="https://lists.jboss.org/mailman/listinfo/keycloak-user" rel="noreferrer" target="_blank">https://lists.jboss.org/mailman/listinfo/keycloak-user</a><br></blockquote></div><br></div>