Package org.apache.camel.component.jms
Class EndpointMessageListener
- java.lang.Object
-
- org.apache.camel.component.jms.EndpointMessageListener
-
- All Implemented Interfaces:
org.springframework.jms.listener.SessionAwareMessageListener
public class EndpointMessageListener extends Object implements org.springframework.jms.listener.SessionAwareMessageListener
A JMSMessageListener
which can be used to delegate processing to a Camel endpoint. Note that instance of this object has to be thread safe (reentrant)
-
-
Constructor Summary
Constructors Constructor Description EndpointMessageListener(JmsConsumer consumer, JmsEndpoint endpoint, org.apache.camel.Processor processor)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description org.apache.camel.Exchange
createExchange(javax.jms.Message message, javax.jms.Session session, Object replyDestination)
protected String
determineCorrelationId(javax.jms.Message message)
Strategy to determine which correlation id to use among JMSMessageID and JMSCorrelationID.JmsBinding
getBinding()
String
getEagerPoisonBody()
Object
getReplyToDestination()
protected Object
getReplyToDestination(javax.jms.Message message)
org.springframework.jms.core.JmsOperations
getTemplate()
boolean
isAsync()
boolean
isDisableReplyTo()
boolean
isEagerLoadingOfProperties()
void
onMessage(javax.jms.Message message, javax.jms.Session session)
protected void
sendReply(String replyDestination, javax.jms.Message message, org.apache.camel.Exchange exchange, org.apache.camel.Message out, Exception cause)
protected void
sendReply(javax.jms.Destination replyDestination, javax.jms.Message message, org.apache.camel.Exchange exchange, org.apache.camel.Message out, Exception cause)
void
setAsync(boolean async)
Sets whether asynchronous routing is enabled.void
setBinding(JmsBinding binding)
Sets the binding used to convert from a Camel message to and from a JMS messagevoid
setDisableReplyTo(boolean disableReplyTo)
Allows the reply-to behaviour to be disabledvoid
setEagerLoadingOfProperties(boolean eagerLoadingOfProperties)
void
setEagerPoisonBody(String eagerPoisonBody)
void
setReplyToDestination(Object replyToDestination)
Provides an explicit reply to destination which overrides any incoming value ofMessage.getJMSReplyTo()
void
setTemplate(org.springframework.jms.core.JmsOperations template)
String
toString()
-
-
-
Constructor Detail
-
EndpointMessageListener
public EndpointMessageListener(JmsConsumer consumer, JmsEndpoint endpoint, org.apache.camel.Processor processor)
-
-
Method Detail
-
onMessage
public void onMessage(javax.jms.Message message, javax.jms.Session session) throws javax.jms.JMSException
- Specified by:
onMessage
in interfaceorg.springframework.jms.listener.SessionAwareMessageListener
- Throws:
javax.jms.JMSException
-
createExchange
public org.apache.camel.Exchange createExchange(javax.jms.Message message, javax.jms.Session session, Object replyDestination)
-
getBinding
public JmsBinding getBinding()
-
setBinding
public void setBinding(JmsBinding binding)
Sets the binding used to convert from a Camel message to and from a JMS message- Parameters:
binding
- the binding to use
-
isEagerLoadingOfProperties
public boolean isEagerLoadingOfProperties()
-
setEagerLoadingOfProperties
public void setEagerLoadingOfProperties(boolean eagerLoadingOfProperties)
-
getEagerPoisonBody
public String getEagerPoisonBody()
-
setEagerPoisonBody
public void setEagerPoisonBody(String eagerPoisonBody)
-
getTemplate
public org.springframework.jms.core.JmsOperations getTemplate()
-
setTemplate
public void setTemplate(org.springframework.jms.core.JmsOperations template)
-
isDisableReplyTo
public boolean isDisableReplyTo()
-
setDisableReplyTo
public void setDisableReplyTo(boolean disableReplyTo)
Allows the reply-to behaviour to be disabled
-
getReplyToDestination
public Object getReplyToDestination()
-
setReplyToDestination
public void setReplyToDestination(Object replyToDestination)
Provides an explicit reply to destination which overrides any incoming value ofMessage.getJMSReplyTo()
- Parameters:
replyToDestination
- the destination that should be used to send replies to as either a String orDestination
type.
-
isAsync
public boolean isAsync()
-
setAsync
public void setAsync(boolean async)
Sets whether asynchronous routing is enabled. By default this is false. If configured as true then this listener will process theExchange
asynchronous.
-
determineCorrelationId
protected String determineCorrelationId(javax.jms.Message message) throws javax.jms.JMSException
Strategy to determine which correlation id to use among JMSMessageID and JMSCorrelationID.- Parameters:
message
- the JMS message- Returns:
- the correlation id to use
- Throws:
javax.jms.JMSException
- can be thrown
-
sendReply
protected void sendReply(javax.jms.Destination replyDestination, javax.jms.Message message, org.apache.camel.Exchange exchange, org.apache.camel.Message out, Exception cause)
-
sendReply
protected void sendReply(String replyDestination, javax.jms.Message message, org.apache.camel.Exchange exchange, org.apache.camel.Message out, Exception cause)
-
getReplyToDestination
protected Object getReplyToDestination(javax.jms.Message message)
-
-