7 Replies Latest reply on Nov 1, 2006 1:48 AM by jiwils

    Can any type of file go in the farm dir?

    andrewboyd

      Hi All,
      I'm moving my application to work in a cluster. At some point one of my servers, server-01 might get an incoming file. It will process the file a little bit and then stores it locally for processing later.

      Since the second server, server-02 may be the server that gets the task of further processing the local file I wanted to put it in the farm dir so I created a sub dir farm/incoming.

      Now when I startup the files that I have in farm/incoming are being deployed by the MainDeployer.

      Does anyone know how I should handle this?

      Thanks,

      Andrew

        • 1. Re: Can any type of file go in the farm dir?
          jimm

          The farm service is intended to deploy deployment units across a cluster. Not merely to copy files. You could extend FarmMemberService and basically copy the FarmMemberService.deploy method without 'supper.deploy(du)' line and this would basically just copy files around. However, this is a bit hackish. Also, the files are only going to be copied as often as the configured ScanPeriod so if server-02 gets the task before the scan on server-01 then server-02 wouldn't see the file.

          I do not know what you are trying to accomplish but a cleaner solution might be to just use JBoss Cache to store the data in the file and then just throw away the file. The data would then be replicated across cluster and persisted however you like.

          If you are looking for distributed replication of a filesystem then you could check out http://labs.jboss.com/portal/davcache
          This project uses JBoss Cache to replicate files across a cluster.

          • 2. Re: Can any type of file go in the farm dir?
            andrewboyd

            Great reply. Thanks that gives me a lot to try.

            Thanks again,

            Andrew

            • 3. Re: Can any type of file go in the farm dir?
              andrewboyd

              Jim,
              I tried extending the FarmMemberService but I get an exception at startup. I created a new thread for the exception:

              http://www.jboss.com/index.html?module=bb&op=viewtopic&t=93274

              Do you have any suggestions?

              Thanks,

              Andrew

              • 4. Re: Can any type of file go in the farm dir?
                jiwils

                I did almost, but note quite what Jim suggested to create a "mirror" service. It even works (there is one minor issue). The main problem for me was that there are some hard coded SERVICE_NAME constants that come into play, so subclassing does not actually work well (you get spurious errors). I basically have a few classes that mirror the farming service's classes with changes to these constants (and a couple of other things). I think I might could even post this little project if anyone cared to see it.

                • 5. Re: Can any type of file go in the farm dir?
                  andrewboyd

                  Yes I'd really apreciate you posting it.

                  Thanks

                  Andrew

                  • 6. Re: Can any type of file go in the farm dir?
                    jiwils

                     

                    "AndrewBoyd" wrote:
                    Yes I'd really apreciate you posting it.


                    Its coming...I've been very busy outside of work these past few days.

                    • 7. Re: Can any type of file go in the farm dir?
                      jiwils

                       

                      "jiwils" wrote:
                      Its coming...I've been very busy outside of work these past few days.


                      Take a look at the beginnings of the MirrorService wiki for a very, very alpha release of the code that should be helpful to you. Check that wiki page for updates later this week. I'll also post an annoucement in the JMX user forum when the first release is available.