Sending e-mail can be an expensive operation, and you generally don’t want your components waiting for e-mail to be sent. To prevent e-mail from being a bottleneck, Dynamo includes an EmailListenerQueue class. This class once again implements EmailListener, so it can be used in place of the SMTPEmail component. Any e-mail messages sent to components of this class are queued up and handled by a separate thread, freeing your component from the potential bottleneck. That separate thread pulls e-mail messages from the queue and sends them to another EmailListener, such as the SMTPEmail component or the SMTPBatchEmail component.

Dynamo comes with an instance of EmailListenerQueue at /atg/dynamo/service/SMTPEmailQueue. This queue empties into the /atg/dynamo/service/SMTPBatchEmail component. Thus, if you send your e-mail events to the queue, they will be first queued and then batched, for maximum performance. If you wish your e-mail queue to empty directly into the SMTPEmail component, simply override the SMTPEmailQueue configuration such that its emailListeners property points to SMTPEmail rather than SMTPBatchEmail.

You’ll probably want to configure your services to send e-mail to the queue, rather than going directly to the SMTPEmail or the SMTPBatchEmail component:

emailListeners=/atg/dynamo/service/SMTPEmailQueue
 
loading table of contents...