This commit is contained in:
Clebert Suconic 2019-01-23 21:30:36 -05:00
commit b73ff1b48e
2 changed files with 6 additions and 1 deletions

View File

@ -223,7 +223,7 @@ public final class Page implements Comparable<Page> {
public synchronized void write(final PagedMessage message) throws Exception {
if (!file.isOpen()) {
return;
throw ActiveMQMessageBundle.BUNDLE.cannotWriteToClosedFile(file);
}
final int messageEncodedSize = message.getEncodeSize();
final int bufferSize = messageEncodedSize + Page.SIZE_RECORD;

View File

@ -44,6 +44,7 @@ import org.apache.activemq.artemis.api.core.ActiveMQUnexpectedRoutingTypeForAddr
import org.apache.activemq.artemis.api.core.DiscoveryGroupConfiguration;
import org.apache.activemq.artemis.api.core.RoutingType;
import org.apache.activemq.artemis.api.core.SimpleString;
import org.apache.activemq.artemis.core.io.SequentialFile;
import org.apache.activemq.artemis.core.postoffice.Binding;
import org.apache.activemq.artemis.core.protocol.core.impl.wireformat.ReplicationSyncFileMessage;
import org.apache.activemq.artemis.core.security.CheckType;
@ -444,4 +445,8 @@ public interface ActiveMQMessageBundle {
@Message(id = 229216, value = "Invalid queue name: {0}", format = Message.Format.MESSAGE_FORMAT)
ActiveMQIllegalStateException invalidQueueName(SimpleString queueName);
@Message(id = 119217, value = "Can't write to closed file: {0}", format = Message.Format.MESSAGE_FORMAT)
ActiveMQIOErrorException cannotWriteToClosedFile(SequentialFile file);
}