cancel
Showing results for 
Search instead for 
Did you mean: 
Read only

Email server(Microsoft) has limitations of only three concurrent connection

former_member797824
Discoverer
0 Kudos
803

Hello everyone,

We are using Microsoft email server and ootb class DefaultEmailService for sending emails. Recently we faced issue where only three email will be delivered if hybris tries to send more than 3 emails and reason is concurrent limitations from MS server. We have requirement to keep existing server.

Are there any ways within hybris to overcome this limitations other than changing server.

Thanks in Advance

Accepted Solutions (1)

Accepted Solutions (1)

mansurarisoy
Contributor

The default task worker count is 10 in SAP commerce installations. So if you have N nodes in a cluster which are running task it is possible to have maximum Nx10 access request to e-mail service. One option would be to decrease the task worker count, so that maximum of 3 request is achieved, but I would not recommend this option since it will degrade the task processing performance.

Another option would be the use of some queue for emails. There are solutions available for queueing like RabbitMQ. I am no expert in RabbitMQ but this may be an option for your case. But it requires additional service and maintaining this will also be needed.

To solve this solely on commerce side, you may override SendEmailAction to not send e-mails and RemoveEmailAction to not delete generated mails. After doing that, you can write a CronJob to send e-mails (Query EmailMessageModel records then send using MailService), after successfully sending, you can remove records from DB (as default process does). By using CronJob you can control how many mails can be sent simultaneously. By default, CronJob runs with a single thread, so default behavior would be 1 mail at a time. But you can increase this by using MultiThreading.

Another option would be implementing some waiting mechanism on SendEmailAction, but since this will block task engine, I would not recommend this option either.

Hope this helps,

former_member797824
Discoverer

Thanks for valuable inputs. This helped a lot.

Answers (0)