org.springframework.integration.jms
Class JmsDestinationPollingSource
java.lang.Object
org.springframework.integration.jms.AbstractJmsTemplateBasedAdapter
org.springframework.integration.jms.JmsDestinationPollingSource
- All Implemented Interfaces:
- org.springframework.beans.factory.InitializingBean, MessageSource<java.lang.Object>
public class JmsDestinationPollingSource
- extends AbstractJmsTemplateBasedAdapter
- implements MessageSource<java.lang.Object>
A source for receiving JMS Messages with a polling listener. This source is
only recommended for very low message volume. Otherwise, the
JmsMessageDrivenEndpoint
that uses Spring's MessageListener container
support is a better option.
- Author:
- Mark Fisher
Method Summary |
protected void |
configureMessageConverter(org.springframework.jms.core.JmsTemplate jmsTemplate,
JmsHeaderMapper headerMapper)
|
Message<java.lang.Object> |
receive()
Retrieve the next available message from this source. |
void |
setExtractPayload(boolean extractPayload)
Specify whether the payload should be extracted from each received JMS
Message to be used as the Spring Integration Message payload. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
JmsDestinationPollingSource
public JmsDestinationPollingSource(org.springframework.jms.core.JmsTemplate jmsTemplate)
JmsDestinationPollingSource
public JmsDestinationPollingSource(javax.jms.ConnectionFactory connectionFactory,
javax.jms.Destination destination)
JmsDestinationPollingSource
public JmsDestinationPollingSource(javax.jms.ConnectionFactory connectionFactory,
java.lang.String destinationName)
setExtractPayload
public void setExtractPayload(boolean extractPayload)
- Specify whether the payload should be extracted from each received JMS
Message to be used as the Spring Integration Message payload.
The default value is true
. To force creation of Spring
Integration Messages whose payload is the actual JMS Message, set this
to false
.
receive
public Message<java.lang.Object> receive()
- Description copied from interface:
MessageSource
- Retrieve the next available message from this source.
Returns
null
if no message is available.
- Specified by:
receive
in interface MessageSource<java.lang.Object>
configureMessageConverter
protected void configureMessageConverter(org.springframework.jms.core.JmsTemplate jmsTemplate,
JmsHeaderMapper headerMapper)
- Specified by:
configureMessageConverter
in class AbstractJmsTemplateBasedAdapter