This commit is contained in:
Justin Bertram 2019-06-19 11:26:33 -05:00
commit aec477932c
3 changed files with 12 additions and 1 deletions

View File

@ -556,6 +556,12 @@ public class JournalStorageManager extends AbstractJournalStorageManager {
final int messageEncodeSize = largeMessage.getEncodeSize();
if (messageEncodeSize > maxRecordSize) {
ActiveMQServerLogger.LOGGER.messageWithHeaderTooLarge(largeMessage.getMessageID(), logger.getName());
if (logger.isDebugEnabled()) {
logger.debug("Message header too large for " + largeMessage);
}
throw ActiveMQJournalBundle.BUNDLE.recordLargerThanStoreMax(messageEncodeSize, maxRecordSize);
}
}

View File

@ -2002,4 +2002,9 @@ public interface ActiveMQServerLogger extends BasicLogger {
@LogMessage(level = Logger.Level.INFO)
@Message(id = 224098, value = "Received a vote saying the backup is live with connector: {0}", format = Message.Format.MESSAGE_FORMAT)
void qourumBackupIsLive(String liveConnector);
@LogMessage(level = Logger.Level.WARN)
@Message(id = 224099, value = "Message with ID {0} has a header too large. More information available on debug level for class {1}",
format = Message.Format.MESSAGE_FORMAT)
void messageWithHeaderTooLarge(Long messageID, String loggerClass);
}

View File

@ -285,7 +285,7 @@ public class AmqpLargeMessageTest extends AmqpClientTestSupport {
connection.connect();
final int strLength = 1024 * 1024;
final int strLength = 512 * 1024;
AmqpSession session = connection.createSession();
AmqpSender sender = session.createSender(testQueueName);