5 Replies Latest reply on Aug 18, 2010 4:55 AM by drakenra

    Specific listener implementation

    t0m.guenter

      Hi,

      in our ESB application we need to use an FTP listener and this works so far really good if simple files are involved. The point is that in our application the file organisation in the source ftp directory is out of our influence and is somewhat dynamic. See below:

      input (ftp-directory, static)
       0000052 (customer id, dynamic)
       filename.xml
       picture1.jpg
       picture2.jpg
       0000065 (customer id, dynamic)
       filname.zip
       filename.xml
       picture1.jpg
       picture2.jpg
       0000076 (customer id, dynamic)
       ...


      The FTP listener should then be able to scan the input directory for newly created directories and download the complete content of these directories.

      As far as I could see, the original ftp-message-filter configuration is limitted on files of a specific type in one directory. Therefore I think that I have to implement a specific listener for this business specific purpose.
      So far I've found one wiki entry regarding an implementation of a completely new listener (http://www.jboss.org/community/docs/DOC-13193) but I'm wondering if there is a way of extending the already existing FTP listener with the specific purposes.

      Of course I could extend and overwrite the existing classes but how can I configure my new classes into the listener configuration. Is there a way of doing such a thing?

      Thanks a lot for any help!
      Tom

        • 1. Re: Specific listener implementation
          marklittle

          You can set it to not look at the input suffix at all and pull in all files. Would that help?

          • 2. Re: Specific listener implementation
            t0m.guenter

            Thanks for the reply, mark.
            Not exactly, no, since I don't want to configure an ftp-listener for every customer available (e.g. one for customer 0000052, another for customer 0000065, and so on).

            The listener should scan for files in any subfolders and apply the message-filter there.

            • 3. Re: Specific listener implementation
              t0m.guenter

              While playing around a bit, I found out that the ordinary wildcards work in suffix attributes. So I set the input-suffix in the ftp-message-filter configuration as shown below and hence I only have to define a filter and listener for every file type that my appear in the sub folders.

              input-suffix="*/*.zip"


              An input-suffix like "*.*" is not very advisable since in this case also directories are treated like files and will be renamed.

              My complete message filter configuration:
              <ftp-message-filter
               username="user"
               password="pw"
               directory="test-thomas"
               input-suffix="*/*.zip"
               work-suffix=".esbInProcess"
               post-delete="true"
               passive="false"
               read-only="false"/>



              • 4. Re: Specific listener implementation
                marklittle

                Glad to hear you made progress.

                • 5. Re: Specific listener implementation
                  drakenra

                  Hi Thomas!

                   

                  I have the same requirement in our project as you got there and I didn't get it to work with JBoss ESB 4.9... I tried your wildcard trick with input-suffix="*/*.zip"... I was wonder which JBoss ESB version you are using?

                   

                  Best Regards, Nhut