7 Replies Latest reply on Jan 14, 2019 11:07 AM by galder.zamarreno

    infinispan modules for wildfly configuration

    jorcx.liu

      hi,

      I'm following this guide Infinispan 9.3 User Guide,and i want enable groups and batch,i configured in standalone-ha.xml.

       

      <subsystem xmlns="urn:infinispan:server:core:9.3">
                  <cache-container name="jdg-container" default-cache="dist" module="org.infinispan.extension:ispn-9.3">
                      <transport channel="jdg-cluster"/>
                      <global-state/>
                      <distributed-cache-configuration name="distributed-template"
                          owners="1"
                          segments="10">
                          <transaction mode="BATCH" />
                          <groups enabled="true" />
                      </distributed-cache-configuration>
                      <distributed-cache name="dist" configuration="distributed-template" />
                  </cache-container>
              </subsystem>
      

       

      but when i start wildfly, i got following error

      21:13:30,741 ERROR [org.jboss.as.controller] (Controller Boot Thread)

      OPVDX001: Validation error in standalone-ha.xml --------------------------------

      |

      |  156:   owners="1"

      |  157:   segments="10">

      |  158:   <transaction mode="BATH" />

      |        ^^^^ Invalid value BATH for mode; legal values are [NON_XA, FULL_XA, NONE,

      |               NON_DURABLE_XA]

      |

      |  159:   <groups enabled="true" />

      |  160: </distributed-cache-configuration>

      |  161: <distributed-cache name="dist" configuration="distributed-template" />

      |

      | The primary underlying error message was:

      | > ParseError at [row,col]:[158,18]

      | > Message: "WFLYCTL0248: Invalid value BATH for mode; legal values are

      | >   [NON_XA, FULL_XA, NONE, NON_DURABLE_XA]"

      |

      |-------------------------------------------------------------------------------

       

      and

       

      ERROR [org.jboss.as.controller] (Controller Boot Thread)

      OPVDX001: Validation error in standalone-ha.xml --------------------------------

      |

      |  157:       segments="10">

      |  158:       <transaction mode="NONE" />

      |  159:       <groups enabled="true" />

      |            ^^^^ 'groups' isn't an allowed element here

      |

      |  160:     </distributed-cache-configuration>

      |  161:     <distributed-cache name="dist" configuration="distributed-template" />

      |  162: </cache-container>

      |

      | The primary underlying error message was:

      | > ParseError at [row,col]:[159,18]

      | > Message: WFLYCTL0198: Unexpected element

      | >   '{urn:infinispan:server:core:9.3}groups' encountered

      |

      |-------------------------------------------------------------------------------

       

      how can i configure with enable group API and BATCH transaction ?

        • 1. Re: infinispan modules for wildfly configuration
          jorcx.liu

          I want configuring caches declaratively

          Can anyone help me?

          thanks

          • 2. Re: infinispan modules for wildfly configuration
            jorcx.liu

            many XML configuration the user guide refer to e.g. <serialization>/<advanced-externalizer>/<auto-commit> etc is not working.

            it is seem that widlfly xml parser is not recognizable

            • 3. Re: infinispan modules for wildfly configuration
              jorcx.liu

              i think configuration in wildfly configured xml (standalone-ha.xml)  is better about using infinispan with wildfly , as cache and cache manager were managed by container, i just inject cache when using. BUT most declarative configuration can not support in this way

              why do the same configuration in XML make use of two ways(<infinispan><global/></infinispan> and <cache-container>...</cache-container>)

              • 4. Re: infinispan modules for wildfly configuration
                jorcx.liu

                i tested BATCH transaction, it is a attribute of CACHE configuration e.g. <distributed-cache name="xxx" batching="true" />

                BUT i can not find a way registering org.infinispan.commons.marshall.AdvancedExternalizer and enable grouping API in <cache-container /> XML configuration

                1 of 1 people found this helpful
                • 5. Re: infinispan modules for wildfly configuration
                  galder.zamarreno

                  Infinispan SPIs auto register externalizers using org.infinispan.lifecycle.ModuleLifecycle implementations. There are plenty of examples of this in the source code but these is an advanced use case, not really geared for end users.

                   

                  Infinispan's configuration in Wildfly is focused on serving Wildfly's use cases, not the use cases of all Infinispan users, hence why only a subset of modules are shipped there. For the full experience, you should deploy Infinispan jar along with your deployment and managed lifecycle in your own application, otherwise you'll keep coming up with roadblocks.

                  1 of 1 people found this helpful
                  • 6. Re: infinispan modules for wildfly configuration
                    jorcx.liu

                    Hi,Galder

                    Thank you for your reply.

                    I can register externalizers using  org.wildfly.clustering.marshalling.Externalizer  although it isn't the best performance.

                    Is it a good way that inject CacheManager e.g.

                    @Produces
                    @Resource(lookup="java:jboss/datagrid-infinispan/container/my-cache-container")
                    private EmbeddedCacheManager myCacheManager;
                    

                    then define caches with the injected CacheManager in program code ?

                    • 7. Re: infinispan modules for wildfly configuration
                      galder.zamarreno

                      Sure, you can create caches on the fly.