Spring Batch
  1. Spring Batch
  2. BATCH-1854

Create Marker Interface to be used by MultiResourceItemReader to inject the resource an item was read from.

    Details

    • Type: Improvement Improvement
    • Status: Resolved
    • Priority: Major Major
    • Resolution: Complete
    • Affects Version/s: 2.1.8
    • Fix Version/s: 2.2.0, 2.2.0 - Sprint 3
    • Component/s: Infrastructure
    • Labels:
      None

      Description

      There are many times when using the MultiResourceItemReader where important information is part of the Resource itself. An example from one my current jobs is a directory with file names like:

      HistoricalPerformance23_FO_USA_M_20120503.xml.zip
      HistoricalPerformance23_FM_USA_M_20120503.xml.zip
      HistoricalPerformance23_FE_USA_M_20120503.xml.zip

      The xml files in this case are all formatted exactly the same, so it's a perfect case for the MultiResourceItemReader. However, the filename itself contains important information. Each file has a different designator: FO, FM, FE, which indicates the 'database' it belongs to. Unfortunately, this information is not included in the records themselves. Therefore, the only solution is to know what Resource (in this case a file) a particular item came from.

      Thus, I would like to create an interface called ResourceAware. If an Item implements this interface, the MRIR will inject the current resource into the item.

        Activity

        There are no comments yet on this issue.

          People

          • Assignee:
            Lucas Ward
            Reporter:
            Lucas Ward
          • Votes:
            1 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved:

              Time Tracking

              Estimated:
              Original Estimate - 0.5d
              0.5d
              Remaining:
              Remaining Estimate - 0.5d
              0.5d
              Logged:
              Time Spent - Not Specified
              Not Specified