• 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
  • Paul Clapham
  • Ron McLeod
  • Jeanne Boyarsky
  • Tim Cooke
Sheriffs:
  • Liutauras Vilda
  • paul wheaton
  • Henry Wong
Saloon Keepers:
  • Tim Moores
  • Tim Holloway
  • Stephan van Hulst
  • Carey Brown
  • Frits Walraven
Bartenders:
  • Piet Souris
  • Himai Minh

Sending Mails with JSF

 
Ranch Hand
Posts: 132
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi there,

I am thinking of the best strategy for stable mail sending in my web application.

I would like to run it on a separate thread, in order to kindof "order" a report and inmediately after be able to work with the app, so that this separate thread sends it to its destination once the thread is done with it (after that the thread would be diposed). The point is that as far as I have seen, creating a new Thread inside the JSF main thread, will prevent JSF's main thread from starting the lifecycle, therefore working with the application while the mail is being cooked is by now impossible.

Can anybody give some hints?
Should I run a separate java process?, or is there a way to run a brand new Thread totally independent from JSF's main thread?

Thanks for your suggestions!

Carlos.
 
Marshal
Posts: 27214
87
Eclipse IDE Firefox Browser MySQL Database
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I don't see why you need to have a separate thread to send an e-mail. (You were referring to e-mail, right?) Sending e-mail isn't a very time-consuming process at all.
 
Carlos Conti
Ranch Hand
Posts: 132
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi Paul,

Thanks for your answer. The point is that the mail will contain a pdf report which takes time to produce, then there are cases where it involves assembling other smaller reports and images.

So that's why.

I have read of a scheduler application called

Quartz

, which would enable me to produce those reports and send the e-mail through another java process, and some how manage the periodicity for the e-mail sending and production. From my perspective I think that should be the most reliable solution if I want to avoid server crashes or unpredictable results, then some reports containt about 30 pages and there's no specific control over image resolution. That could lead me to performance problems in the future. Through a sepparate process I could someway discard those executions which were too time consuming, without interfering at all with JSF's lifecycle.

What do you think?

Many thanks in advance,

Carlos.
 
I was her plaything! And so was this tiny ad:
Free, earth friendly heat - from the CodeRanch trailboss
https://www.kickstarter.com/projects/paulwheaton/free-heat
reply
    Bookmark Topic Watch Topic
  • New Topic