RQ - the request typeRP - the reply typepublic class CamelRequestReplyMessageProducer<RQ extends org.gytheio.messaging.Request<RP>,RP extends org.gytheio.messaging.Reply> extends CamelMessageProducer implements org.gytheio.messaging.RequestReplyMessageProducer<RQ,RP>
A pending requests map is maintained and the CamelRequestReplyMessageProducer.ReplyCallable periodically polls
that map to determine if a correlated reply has been received.
Note that the built-in Camel asynchronous processing was not used for a few reasons:
| Modifier and Type | Class and Description |
|---|---|
class |
CamelRequestReplyMessageProducer.ReplyCallable
Class which polls the pending requests map to determine if a
correlated reply has been received.
|
| Modifier and Type | Field and Description |
|---|---|
protected ExecutorService |
executorService |
protected Map<String,RP> |
pendingRequests |
protected long |
pollingIntervalMs |
protected long |
timeoutMs |
endpoint, ERROR_SENDING, HEADER_JMS_AMQP_MESSAGE_FORMAT, HEADER_JMS_AMQP_MESSAGE_FORMAT_VALUE, producer| Constructor and Description |
|---|
CamelRequestReplyMessageProducer() |
| Modifier and Type | Method and Description |
|---|---|
Future<RP> |
asyncRequest(RQ request) |
void |
init() |
void |
onReceive(Object message) |
void |
setExecutorService(ExecutorService executorService)
The executor service to be used for executing the polling callable
|
void |
setPollingIntervalMs(long pollingIntervalMs)
The pending request polling interval in milliseconds
|
void |
setTimeoutMs(long timeoutMs)
The pending request timeout in milliseconds
|
addHeaders, send, send, send, send, setEndpoint, setProducer, validateEndpointprotected long pollingIntervalMs
protected long timeoutMs
protected ExecutorService executorService
public void setPollingIntervalMs(long pollingIntervalMs)
pollingIntervalMs - public void setTimeoutMs(long timeoutMs)
timeoutMs - public void setExecutorService(ExecutorService executorService)
executorService - public void init()
public void onReceive(Object message)
Copyright © 2014 Alfresco Software. All rights reserved.