This week's book giveaway is in the Java in General forum.
We're giving away four copies of Think Java: How to Think Like a Computer Scientist and have Allen B. Downey & Chris Mayfield on-line!
See this thread for details.
Win a copy of Think Java: How to Think Like a Computer Scientist this week in the Java in General forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

spring batch to check unread message

 
charu java
Greenhorn
Posts: 11
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi Team
I am new to spring and spring batch
I have a requirement to use spring batch to acheive the below things
1.Poll a mail box at regular intervals.
2.Whenever there is a new email in Inbox, irrespective of subject or attachment, place the attachment(if present) in the email into a folder path.
3.Write the details (Time, name of file) into a control table.

I could find many example in javamail api but couldnot find it using springbatch.
Please help me with some sample to acheive it or should i go to spring integration.

ThanKs
C
 
Mark Spritzler
ranger
Sheriff
Posts: 17278
6
IntelliJ IDE Mac Spring
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Well to put it in perspective. They are both operate the exact same regardless of environment. Meaning the code to get the mail and do things with the mail is the exact same whether running in a stand-alone application or in a web application or in a Spring Batch batch job.

What I think you need to look and learn is Spring Batch. Their documentation is actually really good. But you will also have to learn Spring first.

In the end Spring Batch code is a POJO in which you can write code to read an email and do your work just like in a POJO.

Mark
 
Saifuddin Merchant
Ranch Hand
Posts: 607
Firefox Browser Java Spring
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Why do you think spring batch is a good fit for this use case? I don't see which feature of spring batch could be useful for the case you describe.

All you need is a simple Java program that "scheduled" using a scheduler cron, quarts which retrieves mail from the mail box..marks it as read etc
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic