3 Replies Latest reply on Oct 19, 2006 6:29 AM by manik

    Should I us JBossCache to replecate files?

    andrewboyd

      Hi All,
      I have a 2 node cluster. I have files that need to be processed but the server that creates the file might not be the server that processes the file later. I started with adding a sub-dir to the farm dir but JBoss keeps trying to deploy the files but they are just data files and I get ZipExceptions.

      It seems like TreeCache might be a solution that would fit but I haven't seen any examples of using it with files/file objects.

      Would using TreeCache to replicate files across a cluster work? Does anyone have an example of such a use case?

      Thanks,

      Andrew

        • 1. Re: Should I us JBossCache to replecate files?
          manik

          You could do this by writing a wrapper to convert the file to a byte[] and putting this in the cache. On the other end, you could write a cache listener to de-serialize the byte[] to recreate the files.

          It could be done, but this isn't a primary use case for JBoss Cache in any way. Still, I don't see why it cannot be done.

          • 2. Re: Should I us JBossCache to replecate files?
            andrewboyd

            Manik,
            Thanks for the reply & suggestion. If JBossCache is not really designed for file replication across the cluster do you know what I should use?

            I'm trying to use the farm but since my files are flat files and not something deployable, like a jar, I keep getting ZipExceptions. So its not working.

            Andrew

            • 3. Re: Should I us JBossCache to replecate files?
              manik

              Like I said though, while file distribution has not been the primary use case for JBoss Cache, I can't see why it cannot be used for this purpose.

              Other options may be a shared filesytem like NFS or Samba.