5 Replies Latest reply on Aug 1, 2012 3:58 PM by dbschofield

    Httpsession using hot rod and Infinispan with Jboss 7.x

    techtalk

      Hi Ben,

      As suggested I have modified the following in standalon-ha.xml of Jboss 7.1.2.

      1) modify the org.infinispan module.xml to have a dependency on the cache loaders and hotrod client.

              <module name="org.infinispan.client.hotrod"/>

              <module name="org.infinispan.cachestore.remote"/>

              <module name="org.infinispan.cachestore.jdbc"/>

      2) modify the web cache-container to use an invalidation cache backed by a remote-store.  Similar to what Paul suggested with the jdbc-store.

                     <cache-container name="web" aliases="standard-session-cache" default-cache="remote" module="org.jboss.as.clustering.web.infinispan">

                          <transport lock-timeout="60000"/>

                          <invalidation-cache name="remote" mode="ASYNC" batching="true">

                                 <remote-store passivation="false" purge="false" shared="true">

                                     <remote-server outbound-socket-binding="session-datagrid"/>

                                 </remote-store>

                            </invalidation-cache>

                      </cache-container>

      3) Add an outbound-socket-binding to the socket-binding-group your server is using.  This is the host and port of your remote infinispan cache.

                  <outbound-socket-binding name="session-datagrid">

                      <remote-destination host="localhost" port="11222"/>

                  </outbound-socket-binding>

      4) Start an infinispan cache with the hotrod connector.

          jboss\infinispan-5.1.5.FINAL\bin>startServer.bat -r hotrod

       

      However for the 4th point i have some queries ..


      Questions/Concerns :

      1. I cannt see infinispan-5.x folder inside jboss home ? Do i need to donwload Infinispan and place it in jboss home ?

      2. Cannt we use integrated infinispan comes with jboss 7.1.2 ?

       

      Thanks for your time !

      -Manish

        • 1. Re: Httpsession using hot rod and Infinispan with Jboss 7.x
          dbschofield

          1. I cannt see infinispan-5.x folder inside jboss home ? Do i need to donwload Infinispan and place it in jboss home ?

          It doesn't ship with JBoss AS.  I just happen to keep JBoss AS and Infinispan in a jboss folder.  Sorry for the confusion.  You will need to download it and you can keep it anywhere.  Doesn't have to be in jboss home since it is independent of the app server.

          2. Cannt we use integrated infinispan comes with jboss 7.1.2 ?

          I wouldn't recommend it but haven't tried it.  The infinispan shipped with JBoss AS is just the runtime jars.  You won't have the startup scripts to easily launch a remote instance.  If you have an EAP subscription I don't believe Redhat will support it as they view the integrated infinispan as only for the application server runtime.  They would want you to pick up the data grid subscription.

          • 2. Re: Httpsession using hot rod and Infinispan with Jboss 7.x
            techtalk

            Thanks Ben for the reply.. I have downloaded Infinispan 5.1.5 and placed it in D: drive. When I run it using startServer.bat -r hotrod, I am getting log4j errors as discussed here https://community.jboss.org/thread/155807, and did the workaround as described here https://issues.jboss.org/browse/ISPN-2180  .

             

            After that the erorrs has gone in the Infiispan console, however I am not getting anything after I hit the startServer.bat -r hotrod. Just BLANK console and it remains like this forever.. Did you get same errors ? and what you did ?

             

            And how the JBoss knows what Infinispan it has to use and the location  ? Where we should configure that ?

            • 3. Re: Httpsession using hot rod and Infinispan with Jboss 7.x
              dbschofield

              however I am not getting anything after I hit the startServer.bat -r hotrod. Just BLANK console and it remains like this forever.

              What exactly are you trying to "hit"?  What port, protocol, and request params?  A hotrod protocol listener on port 11222 should be running.  This listener will not handle http requests if your "console" is a browser.  If you want to view what is going on in the infinispan cache you will need to use a jmx client.  https://docs.jboss.org/author/display/ISPN/Management+Tooling

               

              And how the JBoss knows what Infinispan it has to use and the location  ? Where we should configure that ?

              You have already configured this by defining the remote-store on the http session cache.  The session-datagrid outbound-socket-binding gives the host and port of your infinispan instance.

              • 4. Re: Httpsession using hot rod and Infinispan with Jboss 7.x
                techtalk

                I am using cmd command D:\infinispan-5.1.5.FINAL\bin>startServer.bat -r hotrod .. Even though I could not see any thing on console (the cmd console) , I still able to run the sample jboss-as7-quickstart application using an invalidation cache mode. It does saving the cache entries "somewhere" and retrieving it back. I am using <remote-destination host="localhost" port="11222"/>

                 

                I dont know where and how my cache is getting saved.. Here cache is of type org.infinispan.AdvancedCache. How can I see my cache ? Is this I need JMX for?

                • 5. Re: Httpsession using hot rod and Infinispan with Jboss 7.x
                  dbschofield

                  Is this I need JMX for?

                  Yes

                   

                  I won't be able to answer all of your Infinispan questions unfortunately.  The documentation is helpful.  https://docs.jboss.org/author/display/ISPN/Home