Announcement Announcement Module
No announcement yet.
Flat File encryption with Spring Batch Page Title Module
Move Remove Collapse
Conversation Detail Module
  • Filter
  • Time
  • Show
Clear All
new posts

  • Flat File encryption with Spring Batch


    I need to encrypt medium/large flat files using PGP.

    Can I get best result do encryption with Spring Batch?

    How to accomplish this? What should I do? Please Guide me.

    Thanks in advance.

  • #2
    Can someone give me an idea(s) to do this?


    • #3
      I don't think Spring Batch really has much to say about it specifically. You need to transform your business data, so you need to plug that into one of the Batch strategies (ItemProcessor, ItemWriter, Tasklet are the obvious places to start).


      • #4
        Thank you for your replay.

        The following way I am going to achieve.

        Batch Configuration:
        <step id="enctyptFile">
        <chunk reader="businessObjectReader"
        <listener ref="fileEncryptStepListener"/>

        Note: Here, Generating flat file based on the DB data. After that encrypting the generated flat file
        bouncycastle-pgp java api for encryption.

        Please Let us know any other better approach(s) to encryption the file.


        • #5
          The approach seems reasonable, the only question is how you want to handle failure. If the encryption fails, what would you do? Furthermore, if the step fails halfway through, do you delete the half written file? I think how you answer that determines whether or not the encryption should be as a separate step, or as a StepListener, as you have implemented.