java - I want to send Run time Notification through E-mail in my designed web application by using Executors Thread Pool -


This may be a silly question, but I am a novice on this, I am creating a web application where notification emails Is sent. For this I am planning to use the Execute Service. I am a bit confused with the executors service, should I use the Executor Service (S) = Executor, Niffix and Pull (10)) in direct way or should I make it in one place and receive the same executable service item every time?

You definitely need to reuse the same executable service object. And probably does not need 10 threads, 1 should be enough.

Instead of defining an executable service as a stable field (although you can do this), if you are using, then you can define it as a spring service or spring or a As a field in singleton: There should be a slightly more predictable behavior in a webpad.

That being said, ideally you should not put this functionality in your webpages at all. A webapp will be positioned on a web server, which is already managing the thread pool. Ideally there should be only one thread pool management per application. Some things related to your new thread may work unexpectedly in some cases, such as its ending.

Ideally, you can send some information to your webpage to someone else, a separate app and dedicated to that purpose, that email should be sent about a queue probably Between two will be the ideal choice for communication technology.

Comments

Popular posts from this blog

c - Mpirun hangs when mpi send and recieve is put in a loop -

python - Apply coupon to a customer's subscription based on non-stripe related actions on the site -

java - Unable to get JDBC connection in Spring application to MySQL -