メールの送信に使用するメソッドがあります。このメソッドをロックして、一度に 1 つのスレッドだけがアクセスできるようにし、残りのスレッドが同時にプールされるようにします。メソッドを同期するか、Spring @transactional PROPAGATION_REQUIRED を使用する必要がありますか?
私のサービス層で
//each time use new thread to send out email
public void sendThroughSMTP(List<String> emails,String subject,String content){
//each time will open and sent through port 25. dont u think this will caused too many threads spawned?
BlastEmailThread blastEmailThread = new BlastEmailThread(emails,subject,content);
blastEmailThread.start();
}