ARTEMIS-1282 ClientSession.ceateQueue (String) method is using temporary queues
This commit is contained in:
parent
24d0a6c8fe
commit
36357e4556
|
@ -531,7 +531,7 @@ public final class ClientSessionImpl implements ClientSessionInternal, FailureLi
|
||||||
SimpleString.toSimpleString(queueName), routingType,
|
SimpleString.toSimpleString(queueName), routingType,
|
||||||
null,
|
null,
|
||||||
false,
|
false,
|
||||||
true,
|
false,
|
||||||
ActiveMQDefaultConfiguration.getDefaultMaxQueueConsumers(),
|
ActiveMQDefaultConfiguration.getDefaultMaxQueueConsumers(),
|
||||||
ActiveMQDefaultConfiguration.getDefaultPurgeOnNoConsumers(),
|
ActiveMQDefaultConfiguration.getDefaultPurgeOnNoConsumers(),
|
||||||
false);
|
false);
|
||||||
|
|
|
@ -38,6 +38,8 @@ import org.apache.activemq.artemis.core.remoting.impl.netty.NettyConnectorFactor
|
||||||
import org.apache.activemq.artemis.core.remoting.impl.netty.TransportConstants;
|
import org.apache.activemq.artemis.core.remoting.impl.netty.TransportConstants;
|
||||||
import org.apache.activemq.artemis.core.server.ActiveMQServer;
|
import org.apache.activemq.artemis.core.server.ActiveMQServer;
|
||||||
import org.apache.activemq.artemis.api.core.RoutingType;
|
import org.apache.activemq.artemis.api.core.RoutingType;
|
||||||
|
import org.apache.activemq.artemis.core.settings.impl.AddressFullMessagePolicy;
|
||||||
|
import org.apache.activemq.artemis.core.settings.impl.AddressSettings;
|
||||||
import org.apache.activemq.artemis.jms.client.ActiveMQConnectionFactory;
|
import org.apache.activemq.artemis.jms.client.ActiveMQConnectionFactory;
|
||||||
import org.apache.activemq.artemis.jms.client.ActiveMQDestination;
|
import org.apache.activemq.artemis.jms.client.ActiveMQDestination;
|
||||||
import org.apache.activemq.artemis.tests.util.ActiveMQTestBase;
|
import org.apache.activemq.artemis.tests.util.ActiveMQTestBase;
|
||||||
|
@ -95,6 +97,15 @@ public class JmsNettyNioStressTest extends ActiveMQTestBase {
|
||||||
TransportConfiguration transportConfig = new TransportConfiguration(ActiveMQTestBase.NETTY_ACCEPTOR_FACTORY, params);
|
TransportConfiguration transportConfig = new TransportConfiguration(ActiveMQTestBase.NETTY_ACCEPTOR_FACTORY, params);
|
||||||
Configuration config = createBasicConfig().setJMXManagementEnabled(false).clearAcceptorConfigurations().addAcceptorConfiguration(transportConfig);
|
Configuration config = createBasicConfig().setJMXManagementEnabled(false).clearAcceptorConfigurations().addAcceptorConfiguration(transportConfig);
|
||||||
ActiveMQServer server = createServer(true, config);
|
ActiveMQServer server = createServer(true, config);
|
||||||
|
|
||||||
|
|
||||||
|
server.getAddressSettingsRepository().clear();
|
||||||
|
AddressSettings defaultSetting = new AddressSettings().setPageSizeBytes(AddressSettings.DEFAULT_PAGE_SIZE).
|
||||||
|
setMaxSizeBytes(AddressSettings.DEFAULT_MAX_SIZE_BYTES).setAddressFullMessagePolicy(AddressFullMessagePolicy.PAGE).
|
||||||
|
setAutoDeleteAddresses(false).setAutoCreateAddresses(true).setAutoCreateQueues(false);
|
||||||
|
|
||||||
|
server.getAddressSettingsRepository().addMatch("#", defaultSetting);
|
||||||
|
|
||||||
server.getConfiguration().setThreadPoolMaxSize(2);
|
server.getConfiguration().setThreadPoolMaxSize(2);
|
||||||
server.start();
|
server.start();
|
||||||
|
|
||||||
|
@ -133,8 +144,13 @@ public class JmsNettyNioStressTest extends ActiveMQTestBase {
|
||||||
ClientSession session = sf.createTransactedSession();
|
ClientSession session = sf.createTransactedSession();
|
||||||
session.createAddress(SimpleString.toSimpleString("queue"), RoutingType.ANYCAST, false);
|
session.createAddress(SimpleString.toSimpleString("queue"), RoutingType.ANYCAST, false);
|
||||||
session.createAddress(SimpleString.toSimpleString("queue2"), RoutingType.ANYCAST, false);
|
session.createAddress(SimpleString.toSimpleString("queue2"), RoutingType.ANYCAST, false);
|
||||||
|
|
||||||
|
Assert.assertTrue(session.addressQuery(SimpleString.toSimpleString("queue")).isExists());
|
||||||
|
Assert.assertTrue(session.addressQuery(SimpleString.toSimpleString("queue2")).isExists());
|
||||||
session.createQueue("queue", RoutingType.ANYCAST, "queue");
|
session.createQueue("queue", RoutingType.ANYCAST, "queue");
|
||||||
session.createQueue("queue2", RoutingType.ANYCAST, "queue2");
|
session.createQueue("queue2", RoutingType.ANYCAST, "queue2");
|
||||||
|
Assert.assertTrue(session.addressQuery(SimpleString.toSimpleString("queue")).isExists());
|
||||||
|
Assert.assertTrue(session.addressQuery(SimpleString.toSimpleString("queue2")).isExists());
|
||||||
session.commit();
|
session.commit();
|
||||||
sf.close();
|
sf.close();
|
||||||
session.close();
|
session.close();
|
||||||
|
@ -151,6 +167,7 @@ public class JmsNettyNioStressTest extends ActiveMQTestBase {
|
||||||
connectionConsumer = cf.createConnection();
|
connectionConsumer = cf.createConnection();
|
||||||
connectionConsumer.start();
|
connectionConsumer.start();
|
||||||
|
|
||||||
|
session.close();
|
||||||
// these threads produce messages on the the first queue
|
// these threads produce messages on the the first queue
|
||||||
for (int i = 0; i < numProducers; i++) {
|
for (int i = 0; i < numProducers; i++) {
|
||||||
new Thread() {
|
new Thread() {
|
||||||
|
|
Loading…
Reference in New Issue