• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

spring batch to check unread message

 
Greenhorn
Posts: 14
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
 
ranger
Posts: 17347
11
Mac IntelliJ IDE Spring
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
 
Ranch Hand
Posts: 608
Firefox Browser Spring Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
 
today's feeble attempt to support the empire
a bit of art, as a gift, that will fit in a stocking
https://gardener-gift.com
reply
    Bookmark Topic Watch Topic
  • New Topic