• 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
  • Tim Cooke
  • paul wheaton
  • Liutauras Vilda
  • Ron McLeod
Sheriffs:
  • Jeanne Boyarsky
  • Devaka Cooray
  • Paul Clapham
Saloon Keepers:
  • Scott Selikoff
  • Tim Holloway
  • Piet Souris
  • Mikalai Zaikin
  • Frits Walraven
Bartenders:
  • Stephan van Hulst
  • Carey Brown

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.
 
Sheriff
Posts: 28344
97
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.
 
Politics n. Poly "many" + ticks "blood sucking insects". Tiny ad:
Gift giving made easy with the permaculture playing cards
https://coderanch.com/t/777758/Gift-giving-easy-permaculture-playing
reply
    Bookmark Topic Watch Topic
  • New Topic