Announcement Announcement Module
No announcement yet.
Spring Integration use case - Please suggest. Page Title Module
Move Remove Collapse
Conversation Detail Module
  • Filter
  • Time
  • Show
Clear All
new posts

  • Spring Integration use case - Please suggest.

    We are in the initially stages /poc-ing the Spring Integration usage in our application.

    Upon receiving a message via a channel.

    1)I want to be able to pick a file from a staging area that I dropped using file adapter earlier.
    2)create a trigger file
    3)Transfer the file via FTP and once ftp is done
    4)I want to send the trigger file over.

    Can anyone please outline the components I have to use to set this thing up in SI.

  • #2
    I assume by "trigger" file, you mean a dummy file that's an indication to the receiver that the original file was successfully sent.

    If I understand you correctly, and assuming the initial message has a File payload...

    1. Service (invoked by a <service-activator>) - creates a list of the original file + trigger file.
            public List<File> createTrigger(File file) {...}
    2. Splitter (simple just <splitter input-channel=".." output-channel/> - splits the list into two messages ->
    3, FTP outbound channel adapter

    If this all runs with DirectChannels, the "trigger file" will be sent after the original file.


    • #3
      Thanks for your reply. Gary.

      a.Trigger file in our case is an xml file consisting of fileId, fileName and other metadata associated with the actual file.
      b.The actual file is an EDI X12, CSV file and its payload size may vary between 10 MB - 100 MB.

      So here I have a XML and X12/CSV. Would it be desirable to have them as one SI message and further split it ? I feel this doesn't seem right.

      To begin with,
      1. This file was initially received by SI file adapter and handed over to Service activator
      2. Service Activator generates Hash value of the file then hands over to Outbound adapter to drop it into a staging area and
      3. Service Activator( the same as above) triggers off an Activiti workflow to perform basic validation dupcheck,file config check by passing the fileName and hashvalue.
      4. Activiti completes the workflow and signals everything is good (in a happy case) and the file can be moved from the staging area to outbound directory/ftp, to be consumed by another system.
      5. The downstream system needs a trigger file (xml file, contains fileId,OFN,etc) in addition to the actual file for processing.

      We have figured out steps 1,2,3 and hoping it can be extended to fit more complex scenarios. But 4 & 5 is where we are kind of hit a road block and unable how to decide which way to go in the SI world.

      Hope I have given you enough background. Kindly suggest.


      • #4
        If you don't want to use the splitter technique I suggested, another alternative is to make the final channel (before the ftp outbound) a <publish-subscribe-channel/>. And subscribe a <transformer order="2"/> to it (with the ftp adapter having order="1").

        After the ftp transfer succeeds the file will be sent to the transformer, which can "transform" it to the trigger file which can then be sent to another ftp adapter.