org.springframework.integration.jms
Class ChannelPublishingJmsMessageListener

java.lang.Object
  extended by org.springframework.integration.context.IntegrationObjectSupport
      extended by org.springframework.integration.endpoint.AbstractEndpoint
          extended by org.springframework.integration.gateway.MessagingGatewaySupport
              extended by org.springframework.integration.jms.ChannelPublishingJmsMessageListener
All Implemented Interfaces:
BeanFactoryAware, BeanNameAware, InitializingBean, Lifecycle, Phased, SmartLifecycle, NamedComponent, TrackableComponent, SessionAwareMessageListener<javax.jms.Message>

public class ChannelPublishingJmsMessageListener
extends MessagingGatewaySupport
implements SessionAwareMessageListener<javax.jms.Message>, InitializingBean

JMS MessageListener that converts a JMS Message into a Spring Integration Message and sends that Message to a channel. If the 'expectReply' value is true, it will also wait for a Spring Integration reply Message and convert that into a JMS reply.


Field Summary
 
Fields inherited from class org.springframework.integration.context.IntegrationObjectSupport
logger
 
Constructor Summary
ChannelPublishingJmsMessageListener()
           
 
Method Summary
 java.lang.String getComponentType()
          Subclasses may implement this method to provide component type information.
 void onMessage(javax.jms.Message jmsMessage, javax.jms.Session session)
           
 void setDefaultReplyDestination(javax.jms.Destination defaultReplyDestination)
          Set the default reply destination to send reply messages to.
 void setDefaultReplyQueueName(java.lang.String destinationName)
          Set the name of the default reply queue to send reply messages to.
 void setDefaultReplyTopicName(java.lang.String destinationName)
          Set the name of the default reply topic to send reply messages to.
 void setDestinationResolver(DestinationResolver destinationResolver)
          Set the DestinationResolver that should be used to resolve reply destination names for this listener.
 void setExpectReply(boolean expectReply)
          Specify whether a JMS reply Message is expected.
 void setExplicitQosEnabledForReplies(boolean explicitQosEnabledForReplies)
          Specify whether explicit QoS should be enabled for replies (for timeToLive, priority, and deliveryMode settings).
 void setExtractReplyPayload(boolean extractReplyPayload)
          Specify whether the Spring Integration reply Message's payload should be extracted prior to converting into a JMS Message.
 void setExtractRequestPayload(boolean extractRequestPayload)
          Specify whether the JMS request Message's body should be extracted prior to converting into a Spring Integration Message.
 void setHeaderMapper(JmsHeaderMapper headerMapper)
          Provide a JmsHeaderMapper implementation to use when converting between JMS Messages and Spring Integration Messages.
 void setMessageConverter(MessageConverter messageConverter)
          Provide a MessageConverter implementation to use when converting between JMS Messages and Spring Integration Messages.
 void setReplyDeliveryPersistent(boolean replyDeliveryPersistent)
          Specify the delivery mode for JMS reply Messages.
 void setReplyPriority(int replyPriority)
          Specify the priority value for JMS reply Messages.
 void setReplyTimeToLive(long replyTimeToLive)
          Specify the time-to-live property for JMS reply Messages.
 
Methods inherited from class org.springframework.integration.gateway.MessagingGatewaySupport
doStart, doStop, onInit, receive, send, sendAndReceive, sendAndReceiveMessage, setErrorChannel, setReplyChannel, setReplyMapper, setReplyTimeout, setRequestChannel, setRequestMapper, setRequestTimeout, setShouldTrack
 
Methods inherited from class org.springframework.integration.endpoint.AbstractEndpoint
getPhase, isAutoStartup, isRunning, setAutoStartup, setPhase, setTaskScheduler, start, stop, stop
 
Methods inherited from class org.springframework.integration.context.IntegrationObjectSupport
afterPropertiesSet, getBeanFactory, getComponentName, getConversionService, getTaskScheduler, setBeanFactory, setBeanName, setComponentName, setConversionService, toString
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface org.springframework.beans.factory.InitializingBean
afterPropertiesSet
 
Methods inherited from interface org.springframework.integration.context.NamedComponent
getComponentName
 

Constructor Detail

ChannelPublishingJmsMessageListener

public ChannelPublishingJmsMessageListener()
Method Detail

getComponentType

public java.lang.String getComponentType()
Description copied from class: IntegrationObjectSupport
Subclasses may implement this method to provide component type information.

Specified by:
getComponentType in interface NamedComponent
Overrides:
getComponentType in class MessagingGatewaySupport

setExpectReply

public void setExpectReply(boolean expectReply)
Specify whether a JMS reply Message is expected.


setDefaultReplyDestination

public void setDefaultReplyDestination(javax.jms.Destination defaultReplyDestination)
Set the default reply destination to send reply messages to. This will be applied in case of a request message that does not carry a "JMSReplyTo" field.


setDefaultReplyQueueName

public void setDefaultReplyQueueName(java.lang.String destinationName)
Set the name of the default reply queue to send reply messages to. This will be applied in case of a request message that does not carry a "JMSReplyTo" field.

Alternatively, specify a JMS Destination object as "defaultReplyDestination".

See Also:
setDestinationResolver(org.springframework.jms.support.destination.DestinationResolver), setDefaultReplyDestination(javax.jms.Destination)

setDefaultReplyTopicName

public void setDefaultReplyTopicName(java.lang.String destinationName)
Set the name of the default reply topic to send reply messages to. This will be applied in case of a request message that does not carry a "JMSReplyTo" field.

Alternatively, specify a JMS Destination object as "defaultReplyDestination".

See Also:
setDestinationResolver(org.springframework.jms.support.destination.DestinationResolver), setDefaultReplyDestination(javax.jms.Destination)

setReplyTimeToLive

public void setReplyTimeToLive(long replyTimeToLive)
Specify the time-to-live property for JMS reply Messages.

See Also:
MessageProducer.setTimeToLive(long)

setReplyPriority

public void setReplyPriority(int replyPriority)
Specify the priority value for JMS reply Messages.

See Also:
MessageProducer.setPriority(int)

setReplyDeliveryPersistent

public void setReplyDeliveryPersistent(boolean replyDeliveryPersistent)
Specify the delivery mode for JMS reply Messages.

See Also:
MessageProducer.setDeliveryMode(int)

setExplicitQosEnabledForReplies

public void setExplicitQosEnabledForReplies(boolean explicitQosEnabledForReplies)
Specify whether explicit QoS should be enabled for replies (for timeToLive, priority, and deliveryMode settings).


setDestinationResolver

public void setDestinationResolver(DestinationResolver destinationResolver)
Set the DestinationResolver that should be used to resolve reply destination names for this listener.

The default resolver is a DynamicDestinationResolver. Specify a JndiDestinationResolver for resolving destination names as JNDI locations.

See Also:
DynamicDestinationResolver, JndiDestinationResolver

setMessageConverter

public void setMessageConverter(MessageConverter messageConverter)
Provide a MessageConverter implementation to use when converting between JMS Messages and Spring Integration Messages. If none is provided, a SimpleMessageConverter will be used.

Parameters:
messageConverter -

setHeaderMapper

public void setHeaderMapper(JmsHeaderMapper headerMapper)
Provide a JmsHeaderMapper implementation to use when converting between JMS Messages and Spring Integration Messages. If none is provided, a DefaultJmsHeaderMapper will be used.


setExtractRequestPayload

public void setExtractRequestPayload(boolean extractRequestPayload)
Specify whether the JMS request Message's body should be extracted prior to converting into a Spring Integration Message. This value is set to true by default. To send the JMS Message itself as a Spring Integration Message payload, set this to false.


setExtractReplyPayload

public void setExtractReplyPayload(boolean extractReplyPayload)
Specify whether the Spring Integration reply Message's payload should be extracted prior to converting into a JMS Message. This value is set to true by default. To send the Spring Integration Message itself as the JMS Message's body, set this to false.


onMessage

public void onMessage(javax.jms.Message jmsMessage,
                      javax.jms.Session session)
               throws javax.jms.JMSException
Specified by:
onMessage in interface SessionAwareMessageListener<javax.jms.Message>
Throws:
javax.jms.JMSException