Class ReplyHolder
- java.lang.Object
-
- org.apache.camel.component.rabbitmq.reply.ReplyHolder
-
public class ReplyHolder extends Object
Holder which contains theExchangeandAsyncCallbackto be used when the reply arrives, so we can set the reply on theExchangeand continue routing using the callback.
-
-
Constructor Summary
Constructors Constructor Description ReplyHolder(org.apache.camel.Exchange exchange, org.apache.camel.AsyncCallback callback, String originalCorrelationId, String correlationId, long timeout)Constructor to use when a timeout occurredReplyHolder(org.apache.camel.Exchange exchange, org.apache.camel.AsyncCallback callback, String originalCorrelationId, String correlationId, com.rabbitmq.client.AMQP.BasicProperties properties, byte[] message)Constructor to use when a reply message was received
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description org.apache.camel.AsyncCallbackgetCallback()StringgetCorrelationId()Gets the correlation idorg.apache.camel.ExchangegetExchange()byte[]getMessage()Gets the received messageStringgetOriginalCorrelationId()Gets the original correlation id, if one was set when sending the message.com.rabbitmq.client.AMQP.BasicPropertiesgetProperties()The message propertieslonggetRequestTimeout()The timeout valuebooleanisTimeout()Whether timeout triggered or not.
-
-
-
Constructor Detail
-
ReplyHolder
public ReplyHolder(org.apache.camel.Exchange exchange, org.apache.camel.AsyncCallback callback, String originalCorrelationId, String correlationId, com.rabbitmq.client.AMQP.BasicProperties properties, byte[] message)Constructor to use when a reply message was received
-
-
Method Detail
-
getExchange
public org.apache.camel.Exchange getExchange()
-
getCallback
public org.apache.camel.AsyncCallback getCallback()
-
getOriginalCorrelationId
public String getOriginalCorrelationId()
Gets the original correlation id, if one was set when sending the message. Some JMS brokers will mess with the correlation id and send back a different/empty correlation id. So we need to remember it so we can restore the correlation id.
-
getCorrelationId
public String getCorrelationId()
Gets the correlation id- See Also:
getOriginalCorrelationId()
-
getMessage
public byte[] getMessage()
Gets the received message- Returns:
- the received message, or null if timeout occurred and no message has been received
- See Also:
isTimeout()
-
isTimeout
public boolean isTimeout()
Whether timeout triggered or not. A timeout is triggered if requestTimeout option has been configured, and a reply message has not been received within that time frame.
-
getRequestTimeout
public long getRequestTimeout()
The timeout value
-
getProperties
public com.rabbitmq.client.AMQP.BasicProperties getProperties()
The message properties
-
-