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

public class QueueMessage extends Object
Queue a message for asynchronous delivery optional delay to a DurableQueueConsumer
Note this method MUST be called within an existing UnitOfWork IF using TransactionalMode.FullyTransactional
Operation also matches DurableQueuesInterceptor.intercept(QueueMessage, InterceptorChain)
  • Field Details

    • queueName

      public final QueueName queueName
  • Constructor Details

  • Method Details

    • builder

      public static QueueMessageBuilder builder()
      Create a new builder that produces a new QueueMessage instance
      Returns:
      a new QueueMessageBuilder instance
    • getQueueName

      public QueueName getQueueName()
      Returns:
      the name of the Queue the message is added to
    • getPayload

      public Object getPayload()
      Returns:
      the message payload
    • getCauseOfEnqueuing

      public Optional<Exception> getCauseOfEnqueuing()
      Returns:
      the optional reason for the message being queued
    • getDeliveryDelay

      public Optional<Duration> getDeliveryDelay()
      Returns:
      the Optional delay for the first delivery of the message to the DurableQueueConsumer
    • setMessage

      public void setMessage(Message message)
      Parameters:
      message - the message being queued (Message/OrderedMessage)
    • getMessage

      public Message getMessage()
      Get the message being queued
      Returns:
      Get the message being queued (Message/OrderedMessage)
    • setDeliveryDelay

      public void setDeliveryDelay(Optional<Duration> deliveryDelay)
      Parameters:
      deliveryDelay - the Optional delay for the first delivery of the message to the DurableQueueConsumer
    • getMetaData

      public MessageMetaData getMetaData()
      Returns:
      metadata metadata related to the message/payload
    • setCauseOfEnqueuing

      public void setCauseOfEnqueuing(Optional<Exception> causeOfEnqueuing)
      Parameters:
      causeOfEnqueuing - the optional reason for the message being queued
    • setDeliveryDelay

      public void setDeliveryDelay(Duration deliveryDelay)
      Parameters:
      deliveryDelay - the Optional delay for the first delivery of the message to the DurableQueueConsumer
    • setCauseOfEnqueuing

      public void setCauseOfEnqueuing(Exception causeOfEnqueuing)
      Parameters:
      causeOfEnqueuing - the optional reason for the message being queued
    • toString

      public String toString()
      Overrides:
      toString in class Object