@Override protected void afterStore(PriorityMQMessage<E> item, byte[] encoded) {
// nothing
}
@Override protected PriorityMQMessage<E> doTake() throws QueueInvalidStateException, QueueFatalException, QueueTimeoutException, DataStoreFatalException {
PriorityMQMessage w = queue.peek();
long itemId = w.key();
byte[] key = priorityKeyUtil.encode(getId(), itemId);
try {
ds.deleteRecord(key);
} catch (RecordNotFoundException e) {
logger.error("Key not found in DataStore for queueId=" + getId() + ", itemId=" + itemId, e);
this.errorCount.incrementAndGet();
} catch (DataStoreFatalException e) {
logger.error("Unable to permanently delete key for queueId=" + getId() + ", itemId=" + itemId, e);
this.errorCount.incrementAndGet();
}
PriorityMQMessage item = queue.remove();
return item;
}