4 Replies Latest reply on Nov 8, 2012 6:41 AM by Paul Ferraro

    HA-JNDI in AS7?

    rang s Newbie

      Can someone tell me how does JNDI work in AS7 in a cluster. Is this HA-JNDI or something different?

        • 1. Re: HA-JNDI in AS7?
          Paul Ferraro Master

          Can you describe your use case?  If you just need a distributed directory - you can use an Infinispan replicated cache directly in your application very easily:

           

          e.g.

          @Resource(lookup = "java:jboss/infinispan/cache/my-container/my-cache")

          private java.util.ConcurrentMap myCache;

           

          ... all using standard APIs.

          • 2. Re: HA-JNDI in AS7?
            Hwang ar Newbie

            I don't have clear the same question.  In this diagram of HA arquitecture of JBoss AS 7, I notice that HA-JNDI exists and is mounted on HA Partition on JGroups but I could not find anything related

            I understand HA JNDI as a common JNDI zone among cluster nodes, am I wrong?

            kk.png

            • 3. Re: HA-JNDI in AS7?
              Hwang ar Newbie

              I answer myself just to be sure I'm pointing in correct direction

               

              The Jboss-7.1.1 way is using an infinispan cache as shared pool to share resources between cluster nodes using for example with the configuration present in standalone-ha.xml

               

                      <cache-container name="cluster" aliases="ha-partition" default-cache="default">
                          <transport lock-timeout="60000"/>
                          <replicated-cache name="default" mode="SYNC" batching="true">
                              <locking isolation="REPEATABLE_READ"/>
                          </replicated-cache>
                      </cache-container>

                                                                                                         

              the code:

              @Resource(lookup="java:jboss/infinispan/container/cluster") 
              private
              org.jboss.as.clustering.infinispan.DefaultEmbeddedCacheManager container; 

               

              container.getCache().put(key, value);

               

              This is the way to share resources in cluster?

               

              Thank you!

              • 4. Re: HA-JNDI in AS7?
                Paul Ferraro Master

                My comment from April 2nd should answer your question already.