Package dev.gmitch215.bytebox
Interface Message<T>
- Type Parameters:
T- the decoded body type
public interface Message<T>
One message from a Queue.
- Since:
- 1.0.0
-
Method Summary
Modifier and TypeMethodDescriptionvoidack()Marks this message delivered regardless of how the handler ends.intattempts()Returns how many times delivery has been attempted, starting at one.body()Returns the decoded body.id()Returns the system-generated message id.voidretry()Marks this message for redelivery in a later batch.voidretry(int delaySeconds) Marks this message for redelivery after a delay.longReturns when the message was sent, in milliseconds since the epoch.
-
Method Details
-
id
String id()Returns the system-generated message id.- Returns:
- the system-generated message id
-
timestamp
long timestamp()Returns when the message was sent, in milliseconds since the epoch.- Returns:
- when the message was sent, in milliseconds since the epoch
-
attempts
int attempts()Returns how many times delivery has been attempted, starting at one.- Returns:
- how many times delivery has been attempted, starting at one
-
body
T body()Returns the decoded body.- Returns:
- the decoded body
-
ack
void ack()Marks this message delivered regardless of how the handler ends. -
retry
void retry()Marks this message for redelivery in a later batch. -
retry
void retry(int delaySeconds) Marks this message for redelivery after a delay.- Parameters:
delaySeconds- how long to wait before redelivering
-