I am not an expert on Spring or Spring batch or Spring integration myself, but I can tell you the practical task that I had to do in my organization in order to use all these requirements for the requirement.
My company takes a credit card from our customers when they sign up and charge them every 30 days. Therefore, every day we must see who is on the 30th day, and authorize our service to them, charging them. Therefore, I have to send data to banks daily.
Step: 1 I had to write a program to receive customer credit card information that should have been sent that day from our secure database through a batch program, and write this content in a specific format that the bank wants in a temporary place on our company server as a ".txt" file (for example: /user/someuser/endofdaytransaction/dd-mm-yyyy.txt)
Step: 2 . As soon as the contents (dd-mm-yyyy.txt) are available in this directory (/ user / oneworld / endofdaytransaction /), I have to connect to the SFTP server server and transfer the file to the directory that the bank provided us with.
I use Spring Batch for Step: 1, the batch job runs through the Quartz scheduler every day at 5 pm and Spring Integration for step: 2, to continue polling the directory and once the file is found, transfer it to the bank.
I also see from Spring docs that I can mashup these technologies, that is, I can avoid writing to a temporary directory and ask Spring Integration to write directly to the bank’s SFTP server.
Another practical example that I could think of: I have AT&T and signed up for Auto Payment, that is, they bill me every 30 days and keep my Internet and phone service active. I have provided AT&T information about my credit card. They combine all the credit cards (subscribers) that will be billed, and send the data to VISA or MASTERCARD, which every day must specify a batch file at a specific time. I hope you can talk about step 1 and step 2, which I spoke about. Happy learning!
oneworld
source share