File polling using the Spring Integration

File polling using the Spring Integration

Whenever you want to read a file from any location , you need to write a lot of code and you need to manage end to end progress of you file. I got an simple way to read file using Spring-Integration where you just need to focus on your business logic , apart from that spring will take care of.

I wanted to read a file from a certain path but I had written a lot of code it was working fine then I got in touch with one of my friend he given suggestion to check File Polling using Spring.

Problems -

  • Write the code to check for file is arrived or not.
  • how to handle duplicate files?
  • how to make sure end -to-end file is following transaction?
  • how to handle overlapping situation?
  • if multiple file arrived a once how you will handle?

Solution -

  • File Polling using Spring-Integration-DSL

I developed an simple use case where I'm reading content file from a folder and just reversing the content of file and posting file in another folder.

You can get the working example on below GitHub repo. Let me know if you are facing any issue while running.

GITHUB - https://github.com/kumarise2012/spring-file-poller

Yash Borade Indrajeet Kumar Ratnesh Kumar

#Springboot #java #Coding

要查看或添加评论,请登录

社区洞察

其他会员也浏览了