Class PendingConfirm
java.lang.Object
org.springframework.amqp.rabbit.connection.PendingConfirm
Instances of this object track pending publisher confirms.
The timestamp allows the pending confirmation to be
expired. It also holds
CorrelationData
for
the client to correlate a confirm with a sent message.- Since:
- 1.0.1
- Author:
- Gary Russell, Ngoc Nhan
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionvoid
Count down the returned message latch; call after the listener has been called.getCause()
The correlation data supplied by the client when sending the message corresponding to this confirmation.long
boolean
True if a returned message has been received.void
When the confirmation is nacked, set the cause when available.void
setReturned
(boolean isReturned) Indicate that a returned message has been received.toString()
boolean
Return true if a return has been passed to the listener or if no return has been received.
-
Constructor Details
-
PendingConfirm
- Parameters:
correlationData
- The correlation data.timestamp
- The timestamp.
-
-
Method Details
-
getCorrelationData
The correlation data supplied by the client when sending the message corresponding to this confirmation.- Returns:
- The correlation data.
-
getTimestamp
public long getTimestamp()- Returns:
- The time the message was sent.
-
setCause
When the confirmation is nacked, set the cause when available.- Parameters:
cause
- The cause.- Since:
- 1.4
-
getCause
- Returns:
- the cause.
- Since:
- 1.4
-
isReturned
public boolean isReturned()True if a returned message has been received.- Returns:
- true if there is a return.
- Since:
- 2.2.10
-
setReturned
public void setReturned(boolean isReturned) Indicate that a returned message has been received.- Parameters:
isReturned
- true if there is a return.- Since:
- 2.2.10
-
waitForReturnIfNeeded
Return true if a return has been passed to the listener or if no return has been received.- Returns:
- false if an expected returned message has not been passed to the listener.
- Throws:
InterruptedException
- if interrupted.- Since:
- 2.2.10
-
countDown
public void countDown()Count down the returned message latch; call after the listener has been called.- Since:
- 2.2.10
-
toString
-