Announcement Announcement Module
Collapse
No announcement yet.
Configure connectors in database? Page Title Module
Move Remove Collapse
X
Conversation Detail Module
Collapse
  • Filter
  • Time
  • Show
Clear All
new posts

  • Configure connectors in database?

    Hello,


    We provide several integration channels (we deal mostly with file interchange) to our customers including (but not limited to):

    - Connectivity via WebsphereMQ (we have to connect to different MQ queues depending on the client).
    - Other proprietary Managed file transfer solutions.

    -SOAP connectors.

    - FTP/SFTP connectivity: we run a secure FTP server to which ours customers can connect to so ,in our side, we use a typical 'File integration'. Furthermore, some customers run their own FTP/SFTP servers and we do need to connect to them.

    -Shared folders.



    For the FTP/SFTP/Remote folders part we now configure different 'channels' in our database stating the URL and credentials (amongst other values we may need: file encoding, 'archive' directory, and so on ).

    This way, our components will get from the database where they need to connect to and it's trivial for us to add a new customer - channel. Moreover, we have our configuration in the database, something we prefer to File configuration.

    How can we leverage Spring integration FTP/SFTP/File adapters in our scenario?





    -

  • #2
    In 2.2, we are considering adding a 'RemoteFileTemplate' (see: https://jira.springsource.org/browse/INT-2120). This will be similar to JmsTemplate, in that it will have some kind of dynamic destination resolver. Each adapter will (optionally) be configurable to use an external template to provide this capability.

    With 2.1, the (s)ftp outbound gateway provides some level of dynamic configuration for get (and ls, rm) operations (file names, directories etc), but only to a fixed destination.

    One technique you could use would be to spin up a separate application context for each destination. The AC would have a session factory with property placeholders for the destination, credentials etc. If you can use Spring 3.1 (RC out now, GA soon), you can pass in a PropertySource to be used by the ProperyPlaceholderConfigurer. The entry point to these mini application contexts could be a simple SI gateway, or even a channel.

    gateway->channel->ftp-ob-adapter

    Once you have an AC for each, you can call use a custom service to send the message into the appropriate context (use getBean() to get a reference to the channel or gateway).
    Last edited by Gary Russell; Dec 13th, 2011, 08:32 AM.

    Comment


    • #3
      Thanks for the prompt response, Gary!

      I think a RemoteFileTemplate would be a nice addition.

      I don't quite understand your suggestion though. So, if I created a different AC for each destination, how would I send the message to the appropriate destination?

      If I understood you correctly, I need a 'gateway' to which all the messages are sent, then, a custom service picks up the message and (based on message properties or content) decides what the real destination should be. Now,it should get a handle to all the different ACs (I don't know how to do that right now) and search for the bean it is interested in; is that it?

      Comment


      • #4
        I will put together a sample illustrating what I mean. Stay tuned!

        Comment


        • #5
          See pull request for a new sample in the spring-integration-samples project...

          https://github.com/SpringSource/spri...amples/pull/20

          If you are not familiar with GitHub, you can browse the files in the new sample here...

          https://github.com/SpringSource/spri.../pull/20/files

          Comment

          Working...
          X