ARTEMIS-3128 - add test of large message browse opentype support

This commit is contained in:
gtully 2021-03-26 14:42:03 +00:00
parent 658d45f543
commit 3b4872e1a2
2 changed files with 14 additions and 1 deletions

View File

@ -392,7 +392,7 @@ public interface Queue extends Bindable,CriticalComponent {
Pair<Boolean, Boolean> checkRedelivery(MessageReference ref, long timeBase, boolean ignoreRedeliveryDelay) throws Exception; Pair<Boolean, Boolean> checkRedelivery(MessageReference ref, long timeBase, boolean ignoreRedeliveryDelay) throws Exception;
/** /**
* It will iterate thorugh memory only (not paging) * It will iterate through memory only (not paging)
* *
* @return * @return
*/ */

View File

@ -25,17 +25,21 @@ import javax.jms.Message;
import javax.jms.MessageConsumer; import javax.jms.MessageConsumer;
import javax.jms.MessageProducer; import javax.jms.MessageProducer;
import javax.jms.Session; import javax.jms.Session;
import javax.management.openmbean.CompositeData;
import java.net.URI; import java.net.URI;
import java.util.Arrays; import java.util.Arrays;
import java.util.concurrent.ThreadLocalRandom; import java.util.concurrent.ThreadLocalRandom;
import java.util.concurrent.TimeUnit; import java.util.concurrent.TimeUnit;
import org.apache.activemq.artemis.api.core.RoutingType;
import org.apache.activemq.artemis.api.core.SimpleString; import org.apache.activemq.artemis.api.core.SimpleString;
import org.apache.activemq.artemis.api.core.management.QueueControl;
import org.apache.activemq.artemis.core.server.ActiveMQServer; import org.apache.activemq.artemis.core.server.ActiveMQServer;
import org.apache.activemq.artemis.core.server.LargeServerMessage; import org.apache.activemq.artemis.core.server.LargeServerMessage;
import org.apache.activemq.artemis.core.server.MessageReference; import org.apache.activemq.artemis.core.server.MessageReference;
import org.apache.activemq.artemis.core.server.Queue; import org.apache.activemq.artemis.core.server.Queue;
import org.apache.activemq.artemis.tests.integration.amqp.AmqpClientTestSupport; import org.apache.activemq.artemis.tests.integration.amqp.AmqpClientTestSupport;
import org.apache.activemq.artemis.tests.integration.management.ManagementControlHelper;
import org.apache.activemq.artemis.tests.util.Wait; import org.apache.activemq.artemis.tests.util.Wait;
import org.apache.activemq.artemis.utils.collections.LinkedListIterator; import org.apache.activemq.artemis.utils.collections.LinkedListIterator;
import org.apache.activemq.transport.amqp.client.AmqpClient; import org.apache.activemq.transport.amqp.client.AmqpClient;
@ -349,6 +353,15 @@ public class SimpleStreamingLargeMessageTest extends AmqpClientTestSupport {
server.start(); server.start();
QueueControl queueControl = ManagementControlHelper.createQueueControl(queue.getAddress(), queue.getName(), RoutingType.ANYCAST, this.mBeanServer);
CompositeData[] browseResult = queueControl.browse();
assertEquals(1, browseResult.length);
if ((boolean) browseResult[0].get("largeMessage")) {
assertTrue(browseResult[0].containsKey("BodyPreview"));
}
connection = client.createConnection(); connection = client.createConnection();
addConnection(connection); addConnection(connection);
connection.setMaxFrameSize(2 * 1024); connection.setMaxFrameSize(2 * 1024);