java.lang.Object
dk.cloudcreate.essentials.components.foundation.messaging.queue.operations.RetryMessage

public class RetryMessage extends Object
Schedule the message for redelivery after the specified deliveryDelay (called by the DurableQueueConsumer)
Note this method MUST be called within an existing UnitOfWork IF using TransactionalMode.FullyTransactional
Operation also matches DurableQueuesInterceptor.intercept(RetryMessage, InterceptorChain)
  • Field Details

  • Constructor Details

    • RetryMessage

      public RetryMessage(QueueEntryId queueEntryId, Exception causeForRetry, Duration deliveryDelay)
      Schedule the message for redelivery after the specified deliveryDelay (called by the DurableQueueConsumer)
      Note this method MUST be called within an existing UnitOfWork IF using TransactionalMode.FullyTransactional
      Parameters:
      queueEntryId - the unique id of the message that must we will retry the delivery of
      causeForRetry - the reason why the message delivery has to be retried
      deliveryDelay - how long will the queue wait until it delivers the message to the DurableQueueConsumer
  • Method Details

    • builder

      public static RetryMessageBuilder builder()
      Create a new builder that produces a new RetryMessage instance
      Returns:
      a new RetryMessageBuilder instance
    • getQueueEntryId

      public QueueEntryId getQueueEntryId()
      Returns:
      the unique id of the message that must we will retry the delivery of
    • getCauseForRetry

      public Exception getCauseForRetry()
      Returns:
      the reason why the message delivery has to be retried
    • setCauseForRetry

      public void setCauseForRetry(Exception causeForRetry)
      Parameters:
      causeForRetry - the reason why the message delivery has to be retried
    • getDeliveryDelay

      public Duration getDeliveryDelay()
      Returns:
      how long will the queue wait until it delivers the message to the DurableQueueConsumer
    • setDeliveryDelay

      public void setDeliveryDelay(Duration deliveryDelay)
      Parameters:
      deliveryDelay - how long will the queue wait until it delivers the message to the DurableQueueConsumer
    • toString

      public String toString()
      Overrides:
      toString in class Object
    • validate

      public void validate()