public abstract class ReplyManagerSupport extends org.apache.camel.support.ServiceSupport implements ReplyManager
ReplyManager
implementations.Modifier and Type | Field and Description |
---|---|
protected org.apache.camel.CamelContext |
camelContext |
protected CorrelationTimeoutMap |
correlation |
protected String |
correlationProperty |
protected JmsEndpoint |
endpoint |
protected ExecutorService |
executorService |
protected org.springframework.jms.listener.AbstractMessageListenerContainer |
listenerContainer |
protected org.slf4j.Logger |
log |
protected javax.jms.Destination |
replyTo |
protected CountDownLatch |
replyToLatch |
protected long |
replyToTimeout |
protected ScheduledExecutorService |
scheduledExecutorService |
Constructor and Description |
---|
ReplyManagerSupport(org.apache.camel.CamelContext camelContext) |
Modifier and Type | Method and Description |
---|---|
protected abstract org.springframework.jms.listener.AbstractMessageListenerContainer |
createListenerContainer() |
protected abstract ReplyHandler |
createReplyHandler(ReplyManager replyManager,
org.apache.camel.Exchange exchange,
org.apache.camel.AsyncCallback callback,
String originalCorrelationId,
String correlationId,
long requestTimeout) |
protected void |
doStart() |
protected void |
doStop() |
javax.jms.Destination |
getReplyTo()
Gets the reply to queue being used
|
protected abstract void |
handleReplyMessage(String correlationID,
javax.jms.Message message,
javax.jms.Session session) |
void |
onMessage(javax.jms.Message message,
javax.jms.Session session) |
void |
processReply(ReplyHolder holder)
Process the reply
|
String |
registerReply(ReplyManager replyManager,
org.apache.camel.Exchange exchange,
org.apache.camel.AsyncCallback callback,
String originalCorrelationId,
String correlationId,
long requestTimeout)
Register a reply
|
void |
setCorrelationProperty(String correlationProperty)
Sets the JMS message property used for message correlation.
|
void |
setEndpoint(JmsEndpoint endpoint)
Sets the belonging
JmsEndpoint . |
void |
setOnTimeoutExecutorService(ExecutorService executorService)
Sets the thread pool to use for continue routing
Exchange when a timeout was triggered
when doing request/reply over JMS. |
void |
setReplyTo(javax.jms.Destination replyTo)
Sets the reply to queue the manager should listen for replies.
|
void |
setScheduledExecutorService(ScheduledExecutorService executorService)
Sets the scheduled thread pool to use when checking for timeouts (no reply received within a given time period)
|
protected ReplyHandler |
waitForProvisionCorrelationToBeUpdated(String correlationID,
javax.jms.Message message)
IMPORTANT: This logic is only being used due to high performance in-memory only
testing using InOut over JMS.
|
doResume, doShutdown, doSuspend, getStatus, getVersion, isRunAllowed, isStarted, isStarting, isStopped, isStopping, isStoppingOrStopped, isSuspended, isSuspending, isSuspendingOrSuspended, resume, shutdown, start, stop, suspend
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
setReplyToSelectorHeader, updateCorrelationId
protected final org.slf4j.Logger log
protected final org.apache.camel.CamelContext camelContext
protected ScheduledExecutorService scheduledExecutorService
protected ExecutorService executorService
protected JmsEndpoint endpoint
protected javax.jms.Destination replyTo
protected org.springframework.jms.listener.AbstractMessageListenerContainer listenerContainer
protected final CountDownLatch replyToLatch
protected final long replyToTimeout
protected CorrelationTimeoutMap correlation
protected String correlationProperty
public ReplyManagerSupport(org.apache.camel.CamelContext camelContext)
public void setScheduledExecutorService(ScheduledExecutorService executorService)
ReplyManager
setScheduledExecutorService
in interface ReplyManager
public void setOnTimeoutExecutorService(ExecutorService executorService)
ReplyManager
Exchange
when a timeout was triggered
when doing request/reply over JMS.setOnTimeoutExecutorService
in interface ReplyManager
public void setEndpoint(JmsEndpoint endpoint)
ReplyManager
JmsEndpoint
.setEndpoint
in interface ReplyManager
public void setReplyTo(javax.jms.Destination replyTo)
ReplyManager
setReplyTo
in interface ReplyManager
public void setCorrelationProperty(String correlationProperty)
ReplyManager
setCorrelationProperty
in interface ReplyManager
public javax.jms.Destination getReplyTo()
ReplyManager
getReplyTo
in interface ReplyManager
public String registerReply(ReplyManager replyManager, org.apache.camel.Exchange exchange, org.apache.camel.AsyncCallback callback, String originalCorrelationId, String correlationId, long requestTimeout)
ReplyManager
registerReply
in interface ReplyManager
replyManager
- the reply manager being usedexchange
- the exchangecallback
- the callbackoriginalCorrelationId
- an optional original correlation idcorrelationId
- the correlation id to expect being usedrequestTimeout
- the timeoutprotected abstract ReplyHandler createReplyHandler(ReplyManager replyManager, org.apache.camel.Exchange exchange, org.apache.camel.AsyncCallback callback, String originalCorrelationId, String correlationId, long requestTimeout)
public void onMessage(javax.jms.Message message, javax.jms.Session session) throws javax.jms.JMSException
onMessage
in interface org.springframework.jms.listener.SessionAwareMessageListener
javax.jms.JMSException
public void processReply(ReplyHolder holder)
ReplyManager
processReply
in interface ReplyManager
holder
- containing needed data to process the reply and continue routingprotected abstract void handleReplyMessage(String correlationID, javax.jms.Message message, javax.jms.Session session)
protected abstract org.springframework.jms.listener.AbstractMessageListenerContainer createListenerContainer() throws Exception
Exception
protected ReplyHandler waitForProvisionCorrelationToBeUpdated(String correlationID, javax.jms.Message message)
protected void doStart() throws Exception
doStart
in class org.apache.camel.support.ServiceSupport
Exception
Apache Camel