-
Notifications
You must be signed in to change notification settings - Fork 1
use MessageWrapper to sync acknowledge and timeout extender #23
Conversation
String.class), e); | ||
throw new RuntimeException(e); | ||
if (e.getCause() instanceof AlreadyAcknowledgedException) { | ||
return; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why introducing the new exception if we just ignore it.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ok, removed with adda920
@Getter | ||
private final Message<I> message; | ||
|
||
private final AtomicBoolean acknowledged = new AtomicBoolean(false); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What is the advantage of heaving an atomic boolean instead of a native boolean? The manipulating methods are already synchronized.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
replaced with boolean d1b1b9b
sync acknowledge and timeout extender: if the message is already acknowledged (deleted) then timeout extender will fail if this happens in the same millisecond