spring-framework / org.springframework.messaging.core / GenericMessagingTemplate

GenericMessagingTemplate

open class GenericMessagingTemplate : AbstractDestinationResolvingMessagingTemplate<MessageChannel>, BeanFactoryAware

A messaging template that resolves destinations names to MessageChannel's to send and receive messages from.

Author
Mark Fisher

Author
Rossen Stoyanchev

Author
Gary Russell

Since
4.0

Constructors

<init>

GenericMessagingTemplate()

A messaging template that resolves destinations names to MessageChannel's to send and receive messages from.

Properties

DEFAULT_RECEIVE_TIMEOUT_HEADER

static val DEFAULT_RECEIVE_TIMEOUT_HEADER: String

DEFAULT_SEND_TIMEOUT_HEADER

static val DEFAULT_SEND_TIMEOUT_HEADER: String

Functions

getReceiveTimeout

open fun getReceiveTimeout(): Long

Return the configured receive operation timeout value.

getReceiveTimeoutHeader

open fun getReceiveTimeoutHeader(): String

Return the configured receive-timeout header.

getSendTimeout

open fun getSendTimeout(): Long

Return the configured default send operation timeout value.

getSendTimeoutHeader

open fun getSendTimeoutHeader(): String

Return the configured send-timeout header.

setBeanFactory

open fun setBeanFactory(beanFactory: BeanFactory): Unit

setReceiveTimeout

open fun setReceiveTimeout(receiveTimeout: Long): Unit

Configure the default timeout value to use for receive operations. May be overridden for individual messages when using sendAndReceive operations.

setReceiveTimeoutHeader

open fun setReceiveTimeoutHeader(receiveTimeoutHeader: String): Unit

Set the name of the header used to determine the send timeout (if present). Default {@value #DEFAULT_RECEIVE_TIMEOUT_HEADER}. The header is removed before sending the message to avoid propagation.

setSendTimeout

open fun setSendTimeout(sendTimeout: Long): Unit

Configure the default timeout value to use for send operations. May be overridden for individual messages.

setSendTimeoutHeader

open fun setSendTimeoutHeader(sendTimeoutHeader: String): Unit

Set the name of the header used to determine the send timeout (if present). Default {@value #DEFAULT_SEND_TIMEOUT_HEADER}.

The header is removed before sending the message to avoid propagation.

setThrowExceptionOnLateReply

open fun setThrowExceptionOnLateReply(throwExceptionOnLateReply: Boolean): Unit

Whether the thread sending a reply should have an exception raised if the receiving thread isn't going to receive the reply either because it timed out, or because it already received a reply, or because it got an exception while sending the request message.

The default value is false in which case only a WARN message is logged. If set to true a MessageDeliveryException is raised in addition to the log message.