use of org.apache.qpid.server.store.MessageDurability in project qpid-broker-j by apache.
the class MessageStoreSerializer_v1 method deserializeMessageInstances.
private Record deserializeMessageInstances(final MessageStore store, final Map<UUID, UUID> queueIdMap, final Map<Long, StoredMessage<?>> messageMap, final Deserializer deserializer, Record nextRecord) throws IOException {
while (nextRecord.getType() == RecordType.MESSAGE_INSTANCE) {
MessageInstanceRecord messageInstanceRecord = (MessageInstanceRecord) nextRecord;
final StoredMessage<?> storedMessage = messageMap.get(messageInstanceRecord.getMessageNumber());
final UUID queueId = queueIdMap.get(messageInstanceRecord.getQueueId());
if (storedMessage != null && queueId != null) {
final Transaction txn = store.newTransaction();
EnqueueableMessage msg = new EnqueueableMessage() {
@Override
public long getMessageNumber() {
return storedMessage.getMessageNumber();
}
@Override
public boolean isPersistent() {
return true;
}
@Override
public StoredMessage getStoredMessage() {
return storedMessage;
}
};
txn.enqueueMessage(new TransactionLogResource() {
@Override
public String getName() {
return queueId.toString();
}
@Override
public UUID getId() {
return queueId;
}
@Override
public MessageDurability getMessageDurability() {
return MessageDurability.DEFAULT;
}
}, msg);
txn.commitTranAsync(null);
}
nextRecord = deserializer.readRecord();
}
return nextRecord;
}
Aggregations