8 Replies Latest reply on Apr 2, 2008 9:03 AM by manik

    How to communicate between Jboss Appserver and Jboss Cache r

    tiroo4u

      Hi,

      I am new to jboss cache as well as jboss appserver. I want to run Jboss Cache as a stand alone application out side my app sever. My web application is deployed in the jboss app server.Can any one please let me know how to communicate between Jboss Cache and Jboss App server running on different JVM's?


      Thanks in advace
      Tiru

        • 1. Re: How to communicate between Jboss Appserver and Jboss Cac
          manik

          what do you mean by communicate? JBoss Cache is a shared in memory data store so if you mean you want to share data, then this works. Start up 2 JBC instances in each JVM, in replicated mode. See docs about this.

          If you want to pass messages between the 2 JVMs, you're probably better off using JMS.

          • 2. Re: How to communicate between Jboss Appserver and Jboss Cac
            tiroo4u

            Hi Manik,

            Thanks for the reply

            Actually I have a Jboss cache running as a stand alone application, ANd my web application is deployed in Jboss App server. In my stand alone jboss cache i am just creating the instance of cache. So from my web app i am trying to access the Cache instance through RMI so that i can put the data through my web application.But its not working as Cache is not implementing Serializable.Plese let me know how we can acheive this .any inputs /Docs/Sample code will be of great help.

            Thanks,
            Tiru

            • 3. Re: How to communicate between Jboss Appserver and Jboss Cac
              manik

              yeah, the cache is not meant to be used in a client-server manner. It is a P2P system.

              What you need to do is to create another cache instance in your web app and put stuff there. The 2 cache instances (standalone + webapp) will replicate data internally.

              • 4. Re: How to communicate between Jboss Appserver and Jboss Cac
                tiroo4u

                Hi Manik,

                Thanks for the quick reply.

                So you mean to say that the two cache instances standalone+webpp should be in replicated mode?

                Thanks,
                Tiru

                • 5. Re: How to communicate between Jboss Appserver and Jboss Cac
                  tiroo4u

                   

                  "tiroo4u" wrote:
                  Hi Manik,

                  Thanks for the quick reply.

                  So you mean to say that the two cache instances standalone+webpp should be in replicated mode?

                  Thanks,
                  Tiru


                  One more clarification. So if we have a cache running in webapp and an independent cache instance running in replicated mode then both cache instance have same amount of data. Does it not take away the advantage of keeping JBC on a separate instance?

                  • 6. Re: How to communicate between Jboss Appserver and Jboss Cac
                    manik

                    Yes, they should be in replicated mode.

                    Each of the 2 instances could be tuned differently to suit their environment, e.g., using different eviction policies to restrict memory usage.

                    Another approach would be to use the TcpDelegatingCacheLoader to "connect" the 2 cache instances.

                    See the user guide for details on this.

                    • 7. Re: How to communicate between Jboss Appserver and Jboss Cac
                      tiroo4u

                      Hi Manik,

                      I am trying to use the RmiDelegatingCacheLoader for creating the cache isntance remotely.I went through the documentation .I have a basic doubt in the same. Can you please let me know how do i do the configuration??

                      Do i need to put the configuration file in my jBOSS appserver?? if so, how do i access the configuration??Or else can you please tell me the basics of how do we use the cache loaders??

                      Looking forward for your response

                      Thanks,
                      Tiru

                      • 8. Re: How to communicate between Jboss Appserver and Jboss Cac
                        manik

                        The RMIDelegatingCacheLoader is deprecated, and does not exist in JBC 2.x onwards.

                        I'd recommend using the TcpDelegatingCacheLoader instead.