4 Replies Latest reply on Apr 19, 2009 4:28 PM by Roger Joelsson

    Camel file-drop component: Lock file remains

    Roger Joelsson Novice

      Short question: When using the file-drop (camel-file) component for inbound messaging (i.e. Camel reading files from a directory), sometimes the .camelLock file remains. The files (messages) get processed correctly, but somehow the lock files remain. Does anyone have a clue on what I possibly do wrong?

        • 1. Re: Camel file-drop component: Lock file remains
          Claus Ibsen Master

          On some platforms such as Windows we have seen an issue with deleting/moving files after it has been processed.

           

          The general workaround was to use .convertBodyTo(String.class) when consuming the file to ensure the payload was converted using a String converter.

           

          I hope that we have it fixed in the next FUSE MR 1.6.0 where we have identified a bug in one of the type converters that could lead to the problem above.

           

          However working with files can be trick on different platforms.

           

          What version of FUSE MR are you using?

          What platform are you using?

           

          And can you show a snippet of your route as well?

          How is your file consumer configured?

          Are the files ASCII or binary based and are they small/big etc?

          • 2. Re: Camel file-drop component: Lock file remains
            Roger Joelsson Novice

            Hi again,

             

            Thanks for your quick reply!

             

            I use the "official" release, i.e. MR 1.5.4 and run it under Microsoft Windows. I will try the .convertBodyTo(String.class) workaround to see whether it helps.

             

            To summarize:

             

            -> What version of FUSE MR are you using?

            1.5.4

             

            -> What platform are you using?

            Microsoft Windows XP SP2

             

            ->And can you show a snippet of your route as well?

            Coming up, though nothing complicated. The route reads a file, processes it somehow - sometimes using splitter and outputs a file (and possibly to other targets):

             

            DSL goes like:

             

            from("file:data/in")

            .splitter()

            ...

            .multicast()

            .to("file:data/out?expression=...", "activemq:something-else"),

             

            Do you see anything controversial?

             

            -> How is your file consumer configured?

            I did use the "noop=true" argument, and it worked (i.e. I did not experience this problem), though it caused other issues upon restarting the container, etc. If possible, I would like the files to moved/deleted upon popping them from the in-queue folder.

             

            -> Are the files ASCII or binary based and are they small/big etc?

            Around 1 Kb (i.e. small) and pure XML (conforming a specific JAXB-handled Schema). Later on in the code I convert them in DOM Document instances, but I read them as Strings. (Actually I experienced problems reading the files directly in DOM Document classes, but I guess that's another issue...)

             

            Comment: The files may appear in a reasonably fast pace, i.e. up to one or two messages (files) per second. I guess this shouldn't be an issue since the files all have different names.

             

            Please let hear from you if I have encountered a bug hear and/or if you need any more information from me!

            • 3. Re: Camel file-drop component: Lock file remains
              Claus Ibsen Master

              Hi

               

              Yeah the bug was related to using Windows routing from files to a JMS destination.

              So the .convertBodyTo(String.class) should fix it. It did for other customers.

               

              We are building FUSE MR 1.6.0 today, that hopefully should contain a fix so you dont need the convert body.

               

              It should be like this with the convert to:

               

              from("file:data/in")

              .convertBodyTo(String.class)

              .splitter()

              • 4. Re: Camel file-drop component: Lock file remains
                Roger Joelsson Novice

                Hi again,

                 

                Thanks a lot for your help -- the convertBodyTo really did the trick!

                 

                As for Camel 1.6.0 I didn't see it released, I guess I'd wait for it to come up the official release download tab?

                 

                Anyway, thanks for your help!