spring-framework / org.springframework.jms.core / JmsMessagingTemplate

JmsMessagingTemplate

open class JmsMessagingTemplate : AbstractMessagingTemplate<Destination>, JmsMessageOperations, InitializingBean

An implementation of JmsMessageOperations.

Author
Stephane Nicoll

Author
Juergen Hoeller

Since
4.1

Constructors

<init>

JmsMessagingTemplate()

Constructor for use with bean properties. Requires #setConnectionFactory or #setJmsTemplate to be called.

JmsMessagingTemplate(connectionFactory: ConnectionFactory)

Create a JmsMessagingTemplate instance with the JMS ConnectionFactory to use, implicitly building a JmsTemplate based on it.

JmsMessagingTemplate(jmsTemplate: JmsTemplate)

Create a JmsMessagingTemplate instance with the JmsTemplate to use.

Functions

afterPropertiesSet

open fun afterPropertiesSet(): Unit

convertAndSend

open fun convertAndSend(payload: Any): Unit
open fun convertAndSend(payload: Any, postProcessor: MessagePostProcessor): Unit
open fun convertAndSend(destinationName: String, payload: Any): Unit
open fun convertAndSend(destinationName: String, payload: Any, headers: MutableMap<String, Any>): Unit
open fun convertAndSend(destinationName: String, payload: Any, postProcessor: MessagePostProcessor): Unit
open fun convertAndSend(destinationName: String, payload: Any, headers: MutableMap<String, Any>, postProcessor: MessagePostProcessor): Unit

convertSendAndReceive

open fun <T : Any> convertSendAndReceive(destinationName: String, request: Any, targetClass: Class<T>): T
open fun <T : Any> convertSendAndReceive(request: Any, targetClass: Class<T>): T
open fun <T : Any> convertSendAndReceive(destinationName: String, request: Any, headers: MutableMap<String, Any>, targetClass: Class<T>): T
open fun <T : Any> convertSendAndReceive(request: Any, targetClass: Class<T>, postProcessor: MessagePostProcessor): T
open fun <T : Any> convertSendAndReceive(destinationName: String, request: Any, targetClass: Class<T>, requestPostProcessor: MessagePostProcessor): T
open fun <T : Any> convertSendAndReceive(destinationName: String, request: Any, headers: MutableMap<String, Any>, targetClass: Class<T>, postProcessor: MessagePostProcessor): T

getConnectionFactory

open fun getConnectionFactory(): ConnectionFactory

Return the ConnectionFactory that the underlying JmsTemplate uses.

getDefaultDestinationName

open fun getDefaultDestinationName(): String

Return the configured default destination name.

getJmsMessageConverter

open fun getJmsMessageConverter(): MessageConverter

Return the MessageConverter to use to convert a Message from the messaging to and from a javax.jms.Message.

getJmsTemplate

open fun getJmsTemplate(): JmsTemplate

Return the configured JmsTemplate.

receive

open fun receive(): Message<*>
open fun receive(destinationName: String): Message<*>

receiveAndConvert

open fun <T : Any> receiveAndConvert(targetClass: Class<T>): T
open fun <T : Any> receiveAndConvert(destinationName: String, targetClass: Class<T>): T

send

open fun send(message: Message<*>): Unit
open fun send(destinationName: String, message: Message<*>): Unit

sendAndReceive

open fun sendAndReceive(requestMessage: Message<*>): Message<*>
open fun sendAndReceive(destinationName: String, requestMessage: Message<*>): Message<*>

setConnectionFactory

open fun setConnectionFactory(connectionFactory: ConnectionFactory): Unit

Set the ConnectionFactory to use for the underlying JmsTemplate.

setDefaultDestinationName

open fun setDefaultDestinationName(defaultDestinationName: String): Unit

Configure the default destination name to use in send methods that don't have a destination argument. If a default destination is not configured, send methods without a destination argument will raise an exception if invoked.

setJmsMessageConverter

open fun setJmsMessageConverter(jmsMessageConverter: MessageConverter): Unit

Set the MessageConverter to use to convert a Message from the messaging to and from a javax.jms.Message. By default, a MessagingMessageConverter is defined using a SimpleMessageConverter to convert the payload of the message.

Consider configuring a MessagingMessageConverter with a different payload converter for more advanced scenarios.

setJmsTemplate

open fun setJmsTemplate(jmsTemplate: JmsTemplate): Unit

Set the JmsTemplate to use.