only 3 thread to access spring service layer at a time while keeping other request in buffer

Viewed 453

We have an utility for sending an email to customers. Currently we are using outlook for sending an emails, But once we send multiple email at a time we get the following error msg.

DEBUG SMTP: MessagingException while sending
com.sun.mail.smtp.SMTPSendFailedException: 432 4.3.2 STOREDRV.ClientSubmit; sender thread limit exceeded

After debugging its found that we can't send 3 mails at a time. So thought another approach to send msgs by queuing the request and process the 3 request at a time while keeping other in buffer.

Note: Don't want to use any msq queuing service (like rabbitMQ etc)

Your suggests/inputs will be really helpful for me.

Thanks

1 Answers

If you are using MS Office SMTP (I guess from the error message), there is a limit on concurrent connection.

Documentation

Under the new limit, up to three concurrent connections are allowed to send email messages at the same time.

Related