ARTEMIS-1455 Fixing issues on Large Message conversion
This commit is contained in:
parent
484e939698
commit
ba1323c8b2
|
@ -2207,7 +2207,11 @@ public class JournalImpl extends JournalBase implements TestableJournal, Journal
|
|||
*/
|
||||
@Override
|
||||
public long getMaxRecordSize() {
|
||||
return Math.min(getFileSize(), fileFactory.getBufferSize());
|
||||
if (fileFactory.getBufferSize() == 0) {
|
||||
return getFileSize();
|
||||
} else {
|
||||
return Math.min(getFileSize(), fileFactory.getBufferSize());
|
||||
}
|
||||
}
|
||||
|
||||
private void flushExecutor(Executor executor) throws InterruptedException {
|
||||
|
|
|
@ -65,6 +65,11 @@ import org.apache.activemq.artemis.utils.IDGenerator;
|
|||
*/
|
||||
public interface StorageManager extends IDGenerator, ActiveMQComponent {
|
||||
|
||||
default long getMaxRecordSize() {
|
||||
/** Null journal is pretty much memory */
|
||||
return Long.MAX_VALUE;
|
||||
}
|
||||
|
||||
void criticalError(Throwable error);
|
||||
|
||||
/**
|
||||
|
|
|
@ -228,6 +228,12 @@ public abstract class AbstractJournalStorageManager extends CriticalComponentImp
|
|||
idGenerator = new BatchingIDGenerator(0, CHECKPOINT_BATCH_SIZE, this);
|
||||
}
|
||||
|
||||
|
||||
public long getMaxRecordSize() {
|
||||
return messageJournal.getMaxRecordSize();
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Called during initialization. Used by implementations to setup Journals, Stores etc...
|
||||
*
|
||||
|
|
|
@ -1333,7 +1333,7 @@ public class ServerSessionImpl implements ServerSession, FailureListener {
|
|||
boolean noAutoCreateQueue) throws Exception {
|
||||
|
||||
final Message message;
|
||||
if ((msg.getEncodeSize() > storageManager.getMessageJournal().getMaxRecordSize()) && !msg.isLargeMessage()) {
|
||||
if ((msg.getEncodeSize() > storageManager.getMaxRecordSize()) && !msg.isLargeMessage()) {
|
||||
message = messageToLargeMessage(msg);
|
||||
} else {
|
||||
message = msg;
|
||||
|
|
Loading…
Reference in New Issue