Class ReplyHolder
java.lang.Object
org.apache.camel.component.jms.reply.ReplyHolder
Holder which contains the
Exchange and AsyncCallback to be used when the reply
arrives, so we can set the reply on the Exchange and continue routing using the callback.-
Constructor Summary
ConstructorsConstructorDescriptionReplyHolder(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, jakarta.jms.Message message, jakarta.jms.Session session) Constructor to use when a reply message was received -
Method Summary
Modifier and TypeMethodDescriptionorg.apache.camel.AsyncCallbackGets the correlation idorg.apache.camel.Exchangejakarta.jms.MessageGets the received messageGets the original correlation id, if one was set when sending the message.longThe timeout valuejakarta.jms.SessionGets the JMS session from the received messagebooleanWhether timeout triggered or not.
-
Constructor Details
-
ReplyHolder
public ReplyHolder(org.apache.camel.Exchange exchange, org.apache.camel.AsyncCallback callback, String originalCorrelationId, String correlationId, jakarta.jms.Message message, jakarta.jms.Session session) Constructor to use when a reply message was received -
ReplyHolder
public ReplyHolder(org.apache.camel.Exchange exchange, org.apache.camel.AsyncCallback callback, String originalCorrelationId, String correlationId, long timeout) Constructor to use when a timeout occurred
-
-
Method Details
-
getExchange
public org.apache.camel.Exchange getExchange() -
getCallback
public org.apache.camel.AsyncCallback getCallback() -
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
Gets the correlation id- See Also:
-
getMessage
public jakarta.jms.Message getMessage()Gets the received message- Returns:
- the received message, or null if timeout occurred and no message has been received
- See Also:
-
getSession
public jakarta.jms.Session getSession()Gets the JMS session from the received message- Returns:
- the JMS session, or null if timeout occurred and no message has been received
- See Also:
-
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
-