org.apache.camel.component.jms.reply
Interface ReplyManager

All Superinterfaces:
MessageListener
All Known Implementing Classes:
PersistentQueueReplyManager, ReplyManagerSupport, TemporaryQueueReplyManager

public interface ReplyManager
extends MessageListener

The ReplyManager is responsible for handling request-reply over JMS.

Version:
$Revision: 20573 $

Method Summary
 Destination getReplyTo()
          Gets the reply to queue being used
 void processReply(ReplyHolder holder)
          Process the reply
 String registerReply(ReplyManager replyManager, Exchange exchange, AsyncCallback callback, String originalCorrelationId, String correlationId, long requestTimeout)
          Register a reply
 void setEndpoint(JmsEndpoint endpoint)
          Sets the belonging JmsEndpoint.
 void setReplyTo(Destination replyTo)
          Sets the reply to queue the manager should listen for replies.
 void setReplyToSelectorHeader(Message camelMessage, Message jmsMessage)
          To be used when a persistent reply queue is used with a custom JMS selector is being used.
 void setScheduledExecutorService(ScheduledExecutorService executorService)
          Sets the scheduled to use when checking for timeouts (no reply received within a given time period)
 void updateCorrelationId(String correlationId, String newCorrelationId, long requestTimeout)
          Updates the correlation id to the new correlation id.
 
Methods inherited from interface javax.jms.MessageListener
onMessage
 

Method Detail

setEndpoint

void setEndpoint(JmsEndpoint endpoint)
Sets the belonging JmsEndpoint.


setReplyTo

void setReplyTo(Destination replyTo)
Sets the reply to queue the manager should listen for replies.

The queue is either a temporary or a persistent queue.


setScheduledExecutorService

void setScheduledExecutorService(ScheduledExecutorService executorService)
Sets the scheduled to use when checking for timeouts (no reply received within a given time period)


getReplyTo

Destination getReplyTo()
Gets the reply to queue being used


setReplyToSelectorHeader

void setReplyToSelectorHeader(Message camelMessage,
                              Message jmsMessage)
                              throws JMSException
To be used when a persistent reply queue is used with a custom JMS selector is being used.

Throws:
JMSException

registerReply

String registerReply(ReplyManager replyManager,
                     Exchange exchange,
                     AsyncCallback callback,
                     String originalCorrelationId,
                     String correlationId,
                     long requestTimeout)
Register a reply

Parameters:
replyManager - the reply manager being used
exchange - the exchange
callback - the callback
originalCorrelationId - an optional original correlation id
correlationId - the correlation id to expect being used
requestTimeout - an optional timeout
Returns:
the correlation id used

updateCorrelationId

void updateCorrelationId(String correlationId,
                         String newCorrelationId,
                         long requestTimeout)
Updates the correlation id to the new correlation id.

This is only used when useMessageIDasCorrelationID option is used, which means a provisional correlation id is first used, then after the message has been sent, the real correlation id is known. This allows us then to update the internal mapping to expect the real correlation id.

Parameters:
correlationId - the provisional correlation id
newCorrelationId - the real correlation id
requestTimeout - an optional timeout

processReply

void processReply(ReplyHolder holder)
Process the reply

Parameters:
holder - containing needed data to process the reply and continue routing


Apache CAMEL