<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">&lt;<a href="mailto:vlcko.rastislav@scheidt-bachmann.sk" target="_blank">vlcko.rastislav@scheidt-bachmann.sk</a>&gt;</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 &quot;max-entries&quot;. In the previous version of Keycloak (1.7.0), the &quot;max-entries&quot; 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:&quot;Courier New&quot;">&lt;cache-container name=&quot;myCacheContainer&quot;&gt;  <u></u><u></u></span></p><p class="MsoNormal"><span style="font-size:10.0pt;font-family:&quot;Courier New&quot;">    &lt;local-cache name=&quot;myCache&quot;&gt;  <u></u><u></u></span></p><p class="MsoNormal"><span style="font-size:10.0pt;font-family:&quot;Courier New&quot;">        &lt;eviction strategy=&quot;LRU&quot; max-entries=&quot;2&quot;/&gt;  <u></u><u></u></span></p><p class="MsoNormal"><span style="font-size:10.0pt;font-family:&quot;Courier New&quot;">        &lt;expiration lifespan=&quot;600000&quot;/&gt;  <u></u><u></u></span></p><p class="MsoNormal"><span style="font-size:10.0pt;font-family:&quot;Courier New&quot;">    &lt;/local-cache&gt;  <u></u><u></u></span></p><p class="MsoNormal"><span style="font-size:10.0pt;font-family:&quot;Courier New&quot;">&lt;/cache-container&gt;<u></u><u></u></span></p><p><span lang="EN-US" style="font-size:11.0pt;font-family:&quot;Calibri&quot;,&quot;sans-serif&quot;">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:&quot;Calibri&quot;,&quot;sans-serif&quot;">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(&quot;myCache&quot;)  <u></u><u></u></code></pre><pre><code>public class MyCache implements IMyCache&lt;String, String&gt; {  <u></u><u></u></code></pre><pre><code><u></u> <u></u></code></pre><pre><code>  @Resource(lookup = &quot;java:jboss/infinispan/container/myCacheContainer&quot;)  <u></u><u></u></code></pre><pre><code>  protected EmbeddedCacheManager container;  <u></u><u></u></code></pre><pre><code>  private Cache&lt;String, String&gt; 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(&quot;myCache&quot;);  <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>