Support for declarative configuration of infinispan-clustered-lock via Wildfly configuration XML

17 views
Skip to first unread message

borna brozovic

unread,
Jun 17, 2024, 10:27:35 AMJun 17
to WildFly
Hello, currently using Wildfly 31.0.1.Final, which ships with Infinispan 14.0.24.Final module. 

Since resolution of this proposal: https://issues.redhat.com/browse/WFLY-13520,
modules: 
  • org.infinispan.cdi
  • org.infinispan.query
  • org.infinispan.counter
  • org.infinispan.lock 
are also included in modules, but Wildfly configuration schema does not yet support elements specific to these modules.

Minimal cache-container configuration which enables infinispan-clustered-lock with default settings:

<cache-container name="lock" marshaller="JBOSS" modules="org.infinispan.lock">

    <transport/>

    <replicated-cache name="repl"/>

</cache-container>


creates internal caches with default settings, but elements defined by infinispan-clustered-lock namespace "urn:infinispan:config:clustered-locks:14.0" are not supported like described in Infinispan's Declarative configuration procedure


<clustered-locks xmlns="urn:infinispan:config:clustered-locks:14.0"

num-owners = "3"

reliability="AVAILABLE">

        <clustered-lock name="lock1" />

        <clustered-lock name="lock2" />

</clustered-locks>


After a thorough research, I was unable to find a solution and would appreciate confirmation that I am not missing something before opening an issue for it.



Paul Ferraro

unread,
Jun 27, 2024, 9:41:55 AM (10 days ago) Jun 27
to WildFly
Support for clustered locks are currently limited to programmatic creation.
e.g. https://github.com/wildfly/wildfly/blob/main/testsuite/integration/clustering/src/test/java/org/jboss/as/test/clustering/cluster/infinispan/lock/deployment/InfinispanLockServlet.java

Given that using clustered locks requires the same code (whether the locks are declared or not) there is not much added value to using declarative configuration, beyond auto-generation of the cache configuration and ClusteredLockManager.defineLock(...) call (easy enough to do via @Startup @Singleton EJB).

Can you file a feature jira?
Thanks,

Paul

borna brozovic

unread,
Jun 27, 2024, 10:36:37 AM (10 days ago) Jun 27
to WildFly
Hi Paul, 

thank you very much for your reply. 
During my research, I have read through complete infinispan-clustered-lock implementation so I am aware of the Lock usage and of the InfinispanLockServlet class. 
I have read my initial post once again and came to conclusion that my problem is possibly not presented specific enough, apologies for that.

In my initial post, I pasted an example of all elements supported by namespace "urn:infinispan:config:clustered-locks:14.0" and I see how <clustered-lock> elements might suggest that I am looking for a way for declarative creation of named locks but I actually require declarative configuration of <reliability> property which is positioned just above <clustered-lock> element.

Using the class you linked as an example, cm is already fully started during invocation of EmbeddedClusteredLockManagerFactory.from(cm), including all internal caches and I am unaware of a way that allows changing reliability property once cm is started.

@Resource(lookup = "java:jboss/infinispan/container/lock")
private EmbeddedCacheManager cm;

@Override
 public void init() throws ServletException {
      clm = EmbeddedClusteredLockManagerFactory.from(cm);
 }

Reply all
Reply to author
Forward
0 new messages