public class MailSendingMessageHandler extends AbstractMessageHandler
MessageHandler
implementation for sending mail.
If the Message is an instance of MailMessage
, it will be passed
as-is. If the Message payload is a byte array, it will be passed as an
attachment, and in that case, the MailHeaders.ATTACHMENT_FILENAME
header is required. Otherwise, a String type is expected, and its content
will be used as the text within a SimpleMailMessage
.
MailHeaders
IntegrationManagement.ManagementOverrides
EXPRESSION_PARSER, logger
HIGHEST_PRECEDENCE, LOWEST_PRECEDENCE
METER_PREFIX, RECEIVE_COUNTER_NAME, SEND_TIMER_NAME
Constructor and Description |
---|
MailSendingMessageHandler(MailSender mailSender)
Create a MailSendingMessageHandler.
|
Modifier and Type | Method and Description |
---|---|
String |
getComponentType()
Subclasses may implement this method to provide component type information.
|
protected void |
handleMessageInternal(Message<?> message) |
handleMessage, onComplete, onError, onNext, onSubscribe
buildSendTimer, destroy, getIntegrationPatternType, getManagedName, getManagedType, getMetricsCaptor, getOrder, getOverrides, isLoggingEnabled, registerMetricsCaptor, sendTimer, setLoggingEnabled, setManagedName, setManagedType, setOrder, setShouldTrack, shouldTrack
afterPropertiesSet, extractTypeIfPossible, generateId, getApplicationContext, getApplicationContextId, getBeanDescription, getBeanFactory, getBeanName, getChannelResolver, getComponentName, getConversionService, getExpression, getIntegrationProperties, getIntegrationProperty, getMessageBuilderFactory, getTaskScheduler, isInitialized, onInit, setApplicationContext, setBeanFactory, setBeanName, setChannelResolver, setComponentName, setConversionService, setMessageBuilderFactory, setPrimaryExpression, setTaskScheduler, toString
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
getThisAs
getBeanName, getComponentName
public MailSendingMessageHandler(MailSender mailSender)
mailSender
- the MailSender
instance to which this
adapter will delegate.public String getComponentType()
IntegrationObjectSupport
getComponentType
in interface NamedComponent
getComponentType
in class MessageHandlerSupport
protected final void handleMessageInternal(Message<?> message)
handleMessageInternal
in class AbstractMessageHandler