public abstract class ReplyManagerSupport extends org.apache.camel.support.ServiceSupport implements ReplyManager
Modifier and Type | Field and Description |
---|---|
protected org.apache.camel.CamelContext |
camelContext |
protected CorrelationTimeoutMap |
correlation |
protected RabbitMQEndpoint |
endpoint |
protected ScheduledExecutorService |
executorService |
protected com.rabbitmq.client.Connection |
listenerContainer |
protected org.slf4j.Logger |
log |
protected String |
replyTo |
protected CountDownLatch |
replyToLatch |
protected long |
replyToTimeout |
Constructor and Description |
---|
ReplyManagerSupport(org.apache.camel.CamelContext camelContext) |
Modifier and Type | Method and Description |
---|---|
void |
cancelCorrelationId(String correlationId)
Unregister a correlationId when you no longer need a reply
|
protected abstract com.rabbitmq.client.Connection |
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() |
String |
getReplyTo()
Gets the reply to queue being used
|
protected abstract void |
handleReplyMessage(String correlationID,
com.rabbitmq.client.AMQP.BasicProperties properties,
byte[] message) |
void |
onMessage(com.rabbitmq.client.AMQP.BasicProperties properties,
byte[] message) |
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 |
setEndpoint(RabbitMQEndpoint endpoint)
Sets the belonging
RabbitMQEndpoint |
void |
setReplyTo(String replyTo)
Sets the reply to queue the manager should listen for replies.
|
void |
setScheduledExecutorService(ScheduledExecutorService executorService)
Sets the scheduled to use when checking for timeouts (no reply received within a given time period)
|
protected ReplyHandler |
waitForProvisionCorrelationToBeUpdated(String correlationID,
byte[] 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
updateCorrelationId
protected final org.slf4j.Logger log
protected final org.apache.camel.CamelContext camelContext
protected final CountDownLatch replyToLatch
protected final long replyToTimeout
protected ScheduledExecutorService executorService
protected RabbitMQEndpoint endpoint
protected String replyTo
protected com.rabbitmq.client.Connection listenerContainer
protected CorrelationTimeoutMap correlation
public ReplyManagerSupport(org.apache.camel.CamelContext camelContext)
public void setScheduledExecutorService(ScheduledExecutorService executorService)
ReplyManager
setScheduledExecutorService
in interface ReplyManager
public void setEndpoint(RabbitMQEndpoint endpoint)
ReplyManager
RabbitMQEndpoint
setEndpoint
in interface ReplyManager
public void setReplyTo(String replyTo)
ReplyManager
setReplyTo
in interface ReplyManager
public String 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 cancelCorrelationId(String correlationId)
ReplyManager
cancelCorrelationId
in interface ReplyManager
public void onMessage(com.rabbitmq.client.AMQP.BasicProperties properties, byte[] message)
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, com.rabbitmq.client.AMQP.BasicProperties properties, byte[] message)
protected abstract com.rabbitmq.client.Connection createListenerContainer() throws Exception
Exception
protected ReplyHandler waitForProvisionCorrelationToBeUpdated(String correlationID, byte[] message)
protected void doStart() throws Exception
doStart
in class org.apache.camel.support.ServiceSupport
Exception
Apache Camel