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 JMS
MessageListener 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
ConstructorsConstructorDescriptionEndpointMessageListener(JmsConsumer consumer, JmsEndpoint endpoint, org.apache.camel.Processor processor) -
Method Summary
Modifier and TypeMethodDescriptionorg.apache.camel.ExchangecreateExchange(jakarta.jms.Message message, jakarta.jms.Session session, Object replyDestination) protected StringdetermineCorrelationId(jakarta.jms.Message message) Strategy to determine which correlation id to use among JMSMessageID and JMSCorrelationID.protected ObjectgetReplyToDestination(jakarta.jms.Message message) org.springframework.jms.core.JmsOperationsbooleanisAsync()booleanbooleanvoidonMessage(jakarta.jms.Message message, jakarta.jms.Session session) protected voidsendReply(jakarta.jms.Destination replyDestination, jakarta.jms.Message message, org.apache.camel.Exchange exchange, org.apache.camel.Message out, Exception cause) protected voidsendReply(String replyDestination, jakarta.jms.Message message, org.apache.camel.Exchange exchange, org.apache.camel.Message out, Exception cause) voidsetAsync(boolean async) Sets whether asynchronous routing is enabled.voidsetBinding(JmsBinding binding) Sets the binding used to convert from a Camel message to and from a JMS messagevoidsetDisableReplyTo(boolean disableReplyTo) Allows the reply-to behaviour to be disabledvoidsetEagerLoadingOfProperties(boolean eagerLoadingOfProperties) voidsetEagerPoisonBody(String eagerPoisonBody) voidsetReplyToDestination(Object replyToDestination) Provides an explicit reply to destination which overrides any incoming value ofMessage.getJMSReplyTo()voidsetTemplate(org.springframework.jms.core.JmsOperations template) toString()
-
Constructor Details
-
EndpointMessageListener
public EndpointMessageListener(JmsConsumer consumer, JmsEndpoint endpoint, org.apache.camel.Processor processor)
-
-
Method Details
-
onMessage
public void onMessage(jakarta.jms.Message message, jakarta.jms.Session session) throws jakarta.jms.JMSException - Specified by:
onMessagein interfaceorg.springframework.jms.listener.SessionAwareMessageListener- Throws:
jakarta.jms.JMSException
-
createExchange
public org.apache.camel.Exchange createExchange(jakarta.jms.Message message, jakarta.jms.Session session, Object replyDestination) -
getBinding
-
setBinding
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
-
setEagerPoisonBody
-
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
-
setReplyToDestination
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 orDestinationtype.
-
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 theExchangeasynchronous. -
determineCorrelationId
protected String determineCorrelationId(jakarta.jms.Message message) throws jakarta.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:
jakarta.jms.JMSException- can be thrown
-
sendReply
protected void sendReply(jakarta.jms.Destination replyDestination, jakarta.jms.Message message, org.apache.camel.Exchange exchange, org.apache.camel.Message out, Exception cause) -
sendReply
-
getReplyToDestination
-
toString
-