Class PendingConfirm


  • public class PendingConfirm
    extends Object
    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
    • Constructor Detail

      • PendingConfirm

        public PendingConfirm​(@Nullable
                              CorrelationData correlationData,
                              long timestamp)
        Parameters:
        correlationData - The correlation data.
        timestamp - The timestamp.
    • Method Detail

      • getCorrelationData

        @Nullable
        public CorrelationData 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

        public void setCause​(String cause)
        When the confirmation is nacked, set the cause when available.
        Parameters:
        cause - The cause.
        Since:
        1.4
      • getCause

        @Nullable
        public String 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

        public boolean waitForReturnIfNeeded()
                                      throws InterruptedException
        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