Class QueueMessage
java.lang.Object
dk.cloudcreate.essentials.components.foundation.messaging.queue.operations.QueueMessage
Queue a message for asynchronous delivery optional delay to a
Note this method MUST be called within an existing
Operation also matches
DurableQueueConsumerNote this method MUST be called within an existing
UnitOfWork IF
using TransactionalMode.FullyTransactionalOperation also matches
DurableQueuesInterceptor.intercept(QueueMessage, InterceptorChain)-
Field Summary
Fields -
Constructor Summary
ConstructorsConstructorDescriptionQueueMessage(QueueName queueName, Message message, Exception causeOfEnqueuing, Duration deliveryDelay) Queue a message for asynchronous delivery optional delay to aDurableQueueConsumer
Note this method MUST be called within an existingUnitOfWorkIF usingTransactionalMode.FullyTransactionalQueueMessage(QueueName queueName, Message message, Optional<Exception> causeOfEnqueuing, Optional<Duration> deliveryDelay) Queue a message for asynchronous delivery optional delay to aDurableQueueConsumer
Note this method MUST be called within an existingUnitOfWorkIF usingTransactionalMode.FullyTransactional -
Method Summary
Modifier and TypeMethodDescriptionstatic QueueMessageBuilderbuilder()Create a new builder that produces a newQueueMessageinstanceGet the message being queuedvoidsetCauseOfEnqueuing(Exception causeOfEnqueuing) voidsetCauseOfEnqueuing(Optional<Exception> causeOfEnqueuing) voidsetDeliveryDelay(Duration deliveryDelay) voidsetDeliveryDelay(Optional<Duration> deliveryDelay) voidsetMessage(Message message) toString()
-
Field Details
-
queueName
-
-
Constructor Details
-
QueueMessage
public QueueMessage(QueueName queueName, Message message, Optional<Exception> causeOfEnqueuing, Optional<Duration> deliveryDelay) Queue a message for asynchronous delivery optional delay to aDurableQueueConsumer
Note this method MUST be called within an existingUnitOfWorkIF usingTransactionalMode.FullyTransactional- Parameters:
queueName- the name of the Queue the message is added tomessage- the message being queued (Message/OrderedMessage)causeOfEnqueuing- the optional reason for the message being queueddeliveryDelay- the Optional delay for the first delivery of the message to theDurableQueueConsumer- See Also:
-
QueueMessage
public QueueMessage(QueueName queueName, Message message, Exception causeOfEnqueuing, Duration deliveryDelay) Queue a message for asynchronous delivery optional delay to aDurableQueueConsumer
Note this method MUST be called within an existingUnitOfWorkIF usingTransactionalMode.FullyTransactional- Parameters:
queueName- the name of the Queue the message is added tomessage- the message being queued (Message/OrderedMessage)causeOfEnqueuing- the optional reason for the message being queueddeliveryDelay- the Optional delay for the first delivery of the message to theDurableQueueConsumer- See Also:
-
-
Method Details
-
builder
Create a new builder that produces a newQueueMessageinstance- Returns:
- a new
QueueMessageBuilderinstance
-
getQueueName
- Returns:
- the name of the Queue the message is added to
-
getPayload
- Returns:
- the message payload
-
getCauseOfEnqueuing
- Returns:
- the optional reason for the message being queued
-
getDeliveryDelay
- Returns:
- the Optional delay for the first delivery of the message to the
DurableQueueConsumer
-
setMessage
- Parameters:
message- the message being queued (Message/OrderedMessage)
-
getMessage
Get the message being queued- Returns:
- Get the message being queued (
Message/OrderedMessage)
-
setDeliveryDelay
- Parameters:
deliveryDelay- the Optional delay for the first delivery of the message to theDurableQueueConsumer
-
getMetaData
- Returns:
- metadata metadata related to the message/payload
-
setCauseOfEnqueuing
- Parameters:
causeOfEnqueuing- the optional reason for the message being queued
-
setDeliveryDelay
- Parameters:
deliveryDelay- the Optional delay for the first delivery of the message to theDurableQueueConsumer
-
setCauseOfEnqueuing
- Parameters:
causeOfEnqueuing- the optional reason for the message being queued
-
toString
-