ARTEMIS-4800 simplify QueueConfiguration API
This commit does the following: - deprecate all QueueConfiguration ctors - add `of` static factory methods for all the deprecated ctors - replace any uses of the normal ctors with the `of` counterparts This makes the code more concise and readable.
This commit is contained in:
parent
efdcc56519
commit
14c564a481
|
@ -426,7 +426,7 @@ public final class XmlDataImporter extends ConnectionConfigurationAbtract {
|
|||
ClientSession.QueueQuery queueQuery = session.queueQuery(SimpleString.of(queueName));
|
||||
|
||||
if (!queueQuery.isExists()) {
|
||||
session.createQueue(new QueueConfiguration(queueName).setAddress(address).setRoutingType(routingType).setFilterString(filter));
|
||||
session.createQueue(QueueConfiguration.of(queueName).setAddress(address).setRoutingType(routingType).setFilterString(filter));
|
||||
if (logger.isDebugEnabled()) {
|
||||
logger.debug("Binding queue(name={}, address={}, filter={})", queueName, address, filter);
|
||||
}
|
||||
|
@ -466,7 +466,7 @@ public final class XmlDataImporter extends ConnectionConfigurationAbtract {
|
|||
ClientSession.QueueQuery queueQuery = session.queueQuery(SimpleString.of(queueName));
|
||||
|
||||
if (!queueQuery.isExists()) {
|
||||
session.createQueue(new QueueConfiguration(queueName).setAddress(address).setRoutingType(RoutingType.valueOf(routingType)).setFilterString(filter));
|
||||
session.createQueue(QueueConfiguration.of(queueName).setAddress(address).setRoutingType(RoutingType.valueOf(routingType)).setFilterString(filter));
|
||||
if (logger.isDebugEnabled()) {
|
||||
logger.debug("Binding queue(name={}, address={}, filter={})", queueName, address, filter);
|
||||
}
|
||||
|
|
|
@ -1855,7 +1855,7 @@ public class ArtemisTest extends CliTestBase {
|
|||
try {
|
||||
final int COUNT = 20_000;
|
||||
for (int i = 0; i < COUNT; i++) {
|
||||
activeMQServer.createQueue(new QueueConfiguration("" + i));
|
||||
activeMQServer.createQueue(QueueConfiguration.of("" + i));
|
||||
}
|
||||
TestActionContext context = new TestActionContext();
|
||||
StatQueue statQueue = new StatQueue();
|
||||
|
|
|
@ -71,8 +71,8 @@ public class TransferTest extends CliTestBase {
|
|||
String sourceQueueName = "SOURCE_QUEUE";
|
||||
String targetQueueName = "TARGET_QUEUE";
|
||||
|
||||
server.createQueue(new QueueConfiguration(sourceQueueName).setRoutingType(RoutingType.ANYCAST));
|
||||
server.createQueue(new QueueConfiguration(targetQueueName).setRoutingType(RoutingType.ANYCAST));
|
||||
server.createQueue(QueueConfiguration.of(sourceQueueName).setRoutingType(RoutingType.ANYCAST));
|
||||
server.createQueue(QueueConfiguration.of(targetQueueName).setRoutingType(RoutingType.ANYCAST));
|
||||
|
||||
Session session = createSession(connection);
|
||||
produceMessages(session, sourceQueueName, messages, false);
|
||||
|
|
|
@ -89,7 +89,7 @@ public class ParameterisedAddress {
|
|||
this.queueConfiguration = null;
|
||||
} else {
|
||||
this.address = SimpleString.of(address.substring(0, index));
|
||||
QueueConfiguration queueConfiguration = new QueueConfiguration(address);
|
||||
QueueConfiguration queueConfiguration = QueueConfiguration.of(address);
|
||||
parseQuery(address).forEach(queueConfiguration::set);
|
||||
this.queueConfiguration = queueConfiguration;
|
||||
}
|
||||
|
|
|
@ -115,7 +115,7 @@ public class QueueAttributes implements Serializable {
|
|||
}
|
||||
|
||||
public QueueConfiguration toQueueConfiguration() {
|
||||
return new QueueConfiguration("")
|
||||
return QueueConfiguration.of("")
|
||||
.setDurable(this.getDurable())
|
||||
.setRoutingType(this.getRoutingType())
|
||||
.setExclusive(this.getExclusive())
|
||||
|
|
|
@ -111,10 +111,51 @@ public class QueueConfiguration implements Serializable {
|
|||
private Boolean autoCreated;
|
||||
private Boolean fqqn;
|
||||
|
||||
/**
|
||||
* Instance factory which invokes {@link #setName(SimpleString)}
|
||||
*
|
||||
* @see #setName(SimpleString)
|
||||
*
|
||||
* @param name the name to use for the queue
|
||||
*/
|
||||
public static QueueConfiguration of(final String name) {
|
||||
return new QueueConfiguration(name);
|
||||
}
|
||||
|
||||
/**
|
||||
* Instance factory which invokes {@link #setName(SimpleString)}
|
||||
*
|
||||
* @see #setName(SimpleString)
|
||||
*
|
||||
* @param name the name to use for the queue
|
||||
*/
|
||||
public static QueueConfiguration of(final SimpleString name) {
|
||||
return new QueueConfiguration(name);
|
||||
}
|
||||
|
||||
/**
|
||||
* @param queueConfiguration create a copy of this
|
||||
*/
|
||||
public static QueueConfiguration of(final QueueConfiguration queueConfiguration) {
|
||||
return new QueueConfiguration(queueConfiguration);
|
||||
}
|
||||
|
||||
/**
|
||||
* @deprecated
|
||||
* Use {@link #of(String)} instead.
|
||||
*/
|
||||
@Deprecated(forRemoval = true)
|
||||
public QueueConfiguration() {
|
||||
}
|
||||
|
||||
public QueueConfiguration(QueueConfiguration o) {
|
||||
/**
|
||||
* @deprecated
|
||||
* Use {@link #of(QueueConfiguration)} instead.
|
||||
*
|
||||
* @param o create a copy of this
|
||||
*/
|
||||
@Deprecated(forRemoval = true)
|
||||
public QueueConfiguration(final QueueConfiguration o) {
|
||||
id = o.id;
|
||||
name = o.name;
|
||||
address = o.address;
|
||||
|
@ -154,8 +195,12 @@ public class QueueConfiguration implements Serializable {
|
|||
*
|
||||
* @see #setName(SimpleString)
|
||||
*
|
||||
* @deprecated
|
||||
* Use {@link #of(SimpleString)} instead.
|
||||
*
|
||||
* @param name the name to use for the queue
|
||||
*/
|
||||
@Deprecated(forRemoval = true)
|
||||
public QueueConfiguration(SimpleString name) {
|
||||
setName(name);
|
||||
}
|
||||
|
@ -165,8 +210,12 @@ public class QueueConfiguration implements Serializable {
|
|||
*
|
||||
* @see #setName(SimpleString)
|
||||
*
|
||||
* @deprecated
|
||||
* Use {@link #of(String)} instead.
|
||||
*
|
||||
* @param name the name to use for the queue
|
||||
*/
|
||||
@Deprecated(forRemoval = true)
|
||||
public QueueConfiguration(String name) {
|
||||
this(SimpleString.of(name));
|
||||
}
|
||||
|
@ -779,7 +828,7 @@ public class QueueConfiguration implements Serializable {
|
|||
if (!json.keySet().contains(NAME)) {
|
||||
return null;
|
||||
}
|
||||
QueueConfiguration result = new QueueConfiguration(json.getString(NAME));
|
||||
QueueConfiguration result = QueueConfiguration.of(json.getString(NAME));
|
||||
|
||||
for (Map.Entry<String, JsonValue> entry : json.entrySet()) {
|
||||
result.set(entry.getKey(), entry.getValue().getValueType() == JsonValue.ValueType.STRING ? ((JsonString)entry.getValue()).getString() : entry.getValue().toString());
|
||||
|
|
|
@ -30,7 +30,7 @@ public class QueueConfigurationTest {
|
|||
|
||||
@Test
|
||||
public void testSetGroupRebalancePauseDispatch() {
|
||||
QueueConfiguration queueConfiguration = new QueueConfiguration("TEST");
|
||||
QueueConfiguration queueConfiguration = QueueConfiguration.of("TEST");
|
||||
|
||||
assertNull(queueConfiguration.isGroupRebalancePauseDispatch());
|
||||
|
||||
|
@ -55,7 +55,7 @@ public class QueueConfigurationTest {
|
|||
public void testFqqn() {
|
||||
final SimpleString ADDRESS = RandomUtil.randomSimpleString();
|
||||
final SimpleString QUEUE = RandomUtil.randomSimpleString();
|
||||
QueueConfiguration queueConfiguration = new QueueConfiguration(CompositeAddress.toFullyQualified(ADDRESS, QUEUE));
|
||||
QueueConfiguration queueConfiguration = QueueConfiguration.of(CompositeAddress.toFullyQualified(ADDRESS, QUEUE));
|
||||
assertEquals(ADDRESS, queueConfiguration.getAddress());
|
||||
assertEquals(QUEUE, queueConfiguration.getName());
|
||||
assertTrue(queueConfiguration.isFqqn());
|
||||
|
@ -65,7 +65,7 @@ public class QueueConfigurationTest {
|
|||
public void testFqqnNegative() {
|
||||
final SimpleString ADDRESS = RandomUtil.randomSimpleString();
|
||||
final SimpleString QUEUE = RandomUtil.randomSimpleString();
|
||||
QueueConfiguration queueConfiguration = new QueueConfiguration(QUEUE).setAddress(ADDRESS);
|
||||
QueueConfiguration queueConfiguration = QueueConfiguration.of(QUEUE).setAddress(ADDRESS);
|
||||
assertEquals(ADDRESS, queueConfiguration.getAddress());
|
||||
assertEquals(QUEUE, queueConfiguration.getName());
|
||||
assertFalse(queueConfiguration.isFqqn());
|
||||
|
@ -75,7 +75,7 @@ public class QueueConfigurationTest {
|
|||
public void testFqqnViaAddress() {
|
||||
final SimpleString ADDRESS = RandomUtil.randomSimpleString();
|
||||
final SimpleString QUEUE = RandomUtil.randomSimpleString();
|
||||
QueueConfiguration queueConfiguration = new QueueConfiguration(RandomUtil.randomSimpleString()).setAddress(CompositeAddress.toFullyQualified(ADDRESS, QUEUE));
|
||||
QueueConfiguration queueConfiguration = QueueConfiguration.of(RandomUtil.randomSimpleString()).setAddress(CompositeAddress.toFullyQualified(ADDRESS, QUEUE));
|
||||
assertEquals(ADDRESS, queueConfiguration.getAddress());
|
||||
assertEquals(QUEUE, queueConfiguration.getName());
|
||||
assertTrue(queueConfiguration.isFqqn());
|
||||
|
|
|
@ -51,8 +51,8 @@ public final class ClientRequestor implements AutoCloseable {
|
|||
queueSession = session;
|
||||
|
||||
requestProducer = queueSession.createProducer(requestAddress);
|
||||
replyQueue = SimpleString.of(requestAddress + "." + UUID.randomUUID().toString());
|
||||
queueSession.createQueue(new QueueConfiguration(replyQueue).setDurable(false).setTemporary(true));
|
||||
replyQueue = SimpleString.of(requestAddress + "." + UUID.randomUUID());
|
||||
queueSession.createQueue(QueueConfiguration.of(replyQueue).setDurable(false).setTemporary(true));
|
||||
replyConsumer = queueSession.createConsumer(replyQueue);
|
||||
}
|
||||
|
||||
|
|
|
@ -303,7 +303,7 @@ public class ActiveMQSessionContext extends SessionContext {
|
|||
Boolean purgeOnNoConsumers,
|
||||
Boolean exclusive,
|
||||
Boolean lastValue) throws ActiveMQException {
|
||||
createSharedQueue(new QueueConfiguration(queueName)
|
||||
createSharedQueue(QueueConfiguration.of(queueName)
|
||||
.setAddress(address)
|
||||
.setRoutingType(routingType)
|
||||
.setFilterString(filterString)
|
||||
|
@ -334,7 +334,7 @@ public class ActiveMQSessionContext extends SessionContext {
|
|||
RoutingType routingType,
|
||||
SimpleString filterString,
|
||||
boolean durable) throws ActiveMQException {
|
||||
createSharedQueue(new QueueConfiguration(queueName)
|
||||
createSharedQueue(QueueConfiguration.of(queueName)
|
||||
.setAddress(address)
|
||||
.setRoutingType(routingType)
|
||||
.setFilterString(filterString)
|
||||
|
@ -347,7 +347,7 @@ public class ActiveMQSessionContext extends SessionContext {
|
|||
SimpleString queueName,
|
||||
SimpleString filterString,
|
||||
boolean durable) throws ActiveMQException {
|
||||
createSharedQueue(new QueueConfiguration(queueName)
|
||||
createSharedQueue(QueueConfiguration.of(queueName)
|
||||
.setAddress(address)
|
||||
.setFilterString(filterString)
|
||||
.setDurable(durable));
|
||||
|
@ -770,7 +770,7 @@ public class ActiveMQSessionContext extends SessionContext {
|
|||
boolean durable,
|
||||
boolean temp,
|
||||
boolean autoCreated) throws ActiveMQException {
|
||||
createQueue(new QueueConfiguration(queueName)
|
||||
createQueue(QueueConfiguration.of(queueName)
|
||||
.setAddress(address)
|
||||
.setFilterString(filterString)
|
||||
.setDurable(durable)
|
||||
|
@ -806,7 +806,7 @@ public class ActiveMQSessionContext extends SessionContext {
|
|||
boolean autoCreated,
|
||||
Boolean exclusive,
|
||||
Boolean lastValue) throws ActiveMQException {
|
||||
createQueue(new QueueConfiguration(queueName)
|
||||
createQueue(QueueConfiguration.of(queueName)
|
||||
.setAddress(address)
|
||||
.setTemporary(temp)
|
||||
.setAutoCreated(autoCreated)
|
||||
|
@ -830,7 +830,7 @@ public class ActiveMQSessionContext extends SessionContext {
|
|||
int maxConsumers,
|
||||
boolean purgeOnNoConsumers,
|
||||
boolean autoCreated) throws ActiveMQException {
|
||||
createQueue(new QueueConfiguration(queueName)
|
||||
createQueue(QueueConfiguration.of(queueName)
|
||||
.setAddress(address)
|
||||
.setRoutingType(routingType)
|
||||
.setFilterString(filterString)
|
||||
|
|
|
@ -189,7 +189,7 @@ public class CreateQueueMessage_V2 extends CreateQueueMessage {
|
|||
}
|
||||
|
||||
public QueueConfiguration toQueueConfiguration() {
|
||||
return new QueueConfiguration(queueName)
|
||||
return QueueConfiguration.of(queueName)
|
||||
.setAddress(address)
|
||||
.setDurable(durable)
|
||||
.setRoutingType(routingType)
|
||||
|
|
|
@ -270,7 +270,7 @@ public class CreateSharedQueueMessage_V2 extends CreateSharedQueueMessage {
|
|||
}
|
||||
|
||||
public QueueConfiguration toQueueConfiguration() {
|
||||
return new QueueConfiguration(queueName)
|
||||
return QueueConfiguration.of(queueName)
|
||||
.setAddress(address)
|
||||
.setDurable(durable)
|
||||
.setRoutingType(routingType)
|
||||
|
|
|
@ -49,7 +49,7 @@ public class AutoCreateUtil {
|
|||
if (!response.isExists() || !response.getQueueNames().contains(queueName)) {
|
||||
if (response.isAutoCreateQueues()) {
|
||||
try {
|
||||
QueueConfiguration queueConfiguration = new QueueConfiguration(queueName)
|
||||
QueueConfiguration queueConfiguration = QueueConfiguration.of(queueName)
|
||||
.setAutoCreated(true)
|
||||
.setAddress(destAddress);
|
||||
setRequiredQueueConfigurationIfNotSet(queueConfiguration,response, RoutingType.ANYCAST, selectorString, true);
|
||||
|
|
|
@ -1039,7 +1039,7 @@ public class ActiveMQSession implements QueueSession, TopicSession {
|
|||
|
||||
SimpleString simpleAddress = queue.getSimpleAddress();
|
||||
|
||||
session.createQueue(new QueueConfiguration(simpleAddress).setRoutingType(RoutingType.ANYCAST).setDurable(false).setTemporary(true));
|
||||
session.createQueue(QueueConfiguration.of(simpleAddress).setRoutingType(RoutingType.ANYCAST).setDurable(false).setTemporary(true));
|
||||
|
||||
connection.addTemporaryQueue(simpleAddress);
|
||||
|
||||
|
@ -1073,7 +1073,7 @@ public class ActiveMQSession implements QueueSession, TopicSession {
|
|||
// does not exist - otherwise we would not be able to distinguish from a non existent topic and one with no
|
||||
// subscriptions - core has no notion of a topic
|
||||
|
||||
session.createQueue(new QueueConfiguration(simpleAddress).setAddress(simpleAddress).setFilterString(ActiveMQSession.REJECTING_FILTER).setDurable(false).setTemporary(true));
|
||||
session.createQueue(QueueConfiguration.of(simpleAddress).setAddress(simpleAddress).setFilterString(ActiveMQSession.REJECTING_FILTER).setDurable(false).setTemporary(true));
|
||||
|
||||
connection.addTemporaryQueue(simpleAddress);
|
||||
|
||||
|
@ -1292,19 +1292,19 @@ public class ActiveMQSession implements QueueSession, TopicSession {
|
|||
}
|
||||
|
||||
void createTemporaryQueue(ActiveMQDestination destination, RoutingType routingType, SimpleString queueName, SimpleString filter, ClientSession.AddressQuery addressQuery) throws ActiveMQException {
|
||||
QueueConfiguration queueConfiguration = destination.getQueueConfiguration() == null ? new QueueConfiguration(queueName) : destination.getQueueConfiguration();
|
||||
QueueConfiguration queueConfiguration = destination.getQueueConfiguration() == null ? QueueConfiguration.of(queueName) : destination.getQueueConfiguration();
|
||||
AutoCreateUtil.setRequiredQueueConfigurationIfNotSet(queueConfiguration, addressQuery, routingType, filter, false);
|
||||
session.createQueue(queueConfiguration.setName(queueName).setAddress(destination.getAddress()).setDurable(false).setTemporary(true));
|
||||
}
|
||||
|
||||
void createSharedQueue(ActiveMQDestination destination, RoutingType routingType, SimpleString queueName, SimpleString filter, boolean durable, ClientSession.AddressQuery addressQuery) throws ActiveMQException {
|
||||
QueueConfiguration queueConfiguration = destination.getQueueConfiguration() == null ? new QueueConfiguration(queueName) : destination.getQueueConfiguration();
|
||||
QueueConfiguration queueConfiguration = destination.getQueueConfiguration() == null ? QueueConfiguration.of(queueName) : destination.getQueueConfiguration();
|
||||
AutoCreateUtil.setRequiredQueueConfigurationIfNotSet(queueConfiguration, addressQuery, routingType, filter, durable);
|
||||
session.createSharedQueue(queueConfiguration.setName(queueName).setAddress(destination.getAddress()).setDurable(durable));
|
||||
}
|
||||
|
||||
void createQueue(ActiveMQDestination destination, RoutingType routingType, SimpleString queueName, SimpleString filter, boolean durable, boolean autoCreated, ClientSession.AddressQuery addressQuery) throws ActiveMQException {
|
||||
QueueConfiguration queueConfiguration = destination.getQueueConfiguration() == null ? new QueueConfiguration(queueName) : destination.getQueueConfiguration();
|
||||
QueueConfiguration queueConfiguration = destination.getQueueConfiguration() == null ? QueueConfiguration.of(queueName) : destination.getQueueConfiguration();
|
||||
AutoCreateUtil.setRequiredQueueConfigurationIfNotSet(queueConfiguration, addressQuery, routingType, filter, durable);
|
||||
session.createQueue(queueConfiguration.setName(queueName).setAddress(destination.getAddress()).setAutoCreated(autoCreated).setDurable(durable));
|
||||
}
|
||||
|
|
|
@ -1082,7 +1082,7 @@ public class JMSServerManagerImpl extends CleaningActivateCallback implements JM
|
|||
|
||||
server.addOrUpdateAddressInfo(new AddressInfo(SimpleString.of(queueName)).addRoutingType(RoutingType.ANYCAST));
|
||||
|
||||
server.createQueue(new QueueConfiguration(queueName).setRoutingType(RoutingType.ANYCAST).setFilterString(coreFilterString).setDurable(durable), true);
|
||||
server.createQueue(QueueConfiguration.of(queueName).setRoutingType(RoutingType.ANYCAST).setFilterString(coreFilterString).setDurable(durable), true);
|
||||
|
||||
// create the JMS queue with the logical name jmsQueueName and keeps queueName for its *core* queue name
|
||||
queues.put(queueName, ActiveMQDestination.createQueue(queueName, jmsQueueName));
|
||||
|
|
|
@ -37,7 +37,7 @@ public class EmbeddedActiveMQResourceCustomConfigurationTest {
|
|||
static final String TEST_QUEUE = "test.queue";
|
||||
static final String TEST_ADDRESS = "test.address";
|
||||
|
||||
QueueConfiguration queueConfiguration = new QueueConfiguration(TEST_QUEUE).setAddress(TEST_ADDRESS);
|
||||
QueueConfiguration queueConfiguration = QueueConfiguration.of(TEST_QUEUE).setAddress(TEST_ADDRESS);
|
||||
Configuration customConfiguration = new ConfigurationImpl().setPersistenceEnabled(false).setSecurityEnabled(true).addQueueConfiguration(queueConfiguration);
|
||||
|
||||
private EmbeddedActiveMQResource server = new EmbeddedActiveMQResource(customConfiguration);
|
||||
|
|
|
@ -38,7 +38,7 @@ public class EmbeddedActiveMQResourceCustomConfigurationTest {
|
|||
static final String TEST_QUEUE = "test.queue";
|
||||
static final String TEST_ADDRESS = "test.address";
|
||||
|
||||
QueueConfiguration queueConfiguration = new QueueConfiguration(TEST_QUEUE).setAddress(TEST_ADDRESS);
|
||||
QueueConfiguration queueConfiguration = QueueConfiguration.of(TEST_QUEUE).setAddress(TEST_ADDRESS);
|
||||
Configuration customConfiguration = new ConfigurationImpl().setPersistenceEnabled(false).setSecurityEnabled(true).addQueueConfiguration(queueConfiguration);
|
||||
|
||||
@RegisterExtension
|
||||
|
|
|
@ -87,7 +87,7 @@ public class ActiveMQConsumerDelegate extends AbstractActiveMQClientDelegate imp
|
|||
log.warn("{}: queue does not exist - creating queue: address = {}, name = {}",
|
||||
this.getClass().getSimpleName(), queueName.toString(), queueName.toString());
|
||||
session.createAddress(queueName, RoutingType.MULTICAST, true);
|
||||
session.createQueue(new QueueConfiguration(queueName));
|
||||
session.createQueue(QueueConfiguration.of(queueName));
|
||||
}
|
||||
consumer = session.createConsumer(queueName, browseOnly);
|
||||
} catch (ActiveMQException amqEx) {
|
||||
|
|
|
@ -69,7 +69,7 @@ public class ActiveMQDynamicProducerDelegate extends ActiveMQProducerDelegate
|
|||
if (address != null && !session.addressQuery(address).isExists() && autoCreateQueue) {
|
||||
log.warn("queue does not exist - creating queue: address = {}, name = {}", address.toString(),
|
||||
address.toString());
|
||||
session.createQueue(new QueueConfiguration(address));
|
||||
session.createQueue(QueueConfiguration.of(address));
|
||||
}
|
||||
producer = session.createProducer((SimpleString) null);
|
||||
} catch (ActiveMQException amqEx) {
|
||||
|
@ -98,7 +98,7 @@ public class ActiveMQDynamicProducerDelegate extends ActiveMQProducerDelegate
|
|||
if (autoCreateQueue && !session.addressQuery(targetAddress).isExists()) {
|
||||
log.warn("queue does not exist - creating queue: address = {}, name = {}", address.toString(),
|
||||
address.toString());
|
||||
session.createQueue(new QueueConfiguration(targetAddress));
|
||||
session.createQueue(QueueConfiguration.of(targetAddress));
|
||||
}
|
||||
} catch (ActiveMQException amqEx) {
|
||||
throw new ActiveMQClientResourceException(String.format("Queue creation failed for queue: address = %s, name = %s",
|
||||
|
|
|
@ -109,7 +109,7 @@ public class ActiveMQProducerDelegate extends AbstractActiveMQClientDelegate imp
|
|||
if (!session.addressQuery(address).isExists() && autoCreateQueue) {
|
||||
log.warn("{}: queue does not exist - creating queue: address = {}, name = {}",
|
||||
this.getClass().getSimpleName(), address.toString(), address.toString());
|
||||
session.createQueue(new QueueConfiguration(address));
|
||||
session.createQueue(QueueConfiguration.of(address));
|
||||
}
|
||||
producer = session.createProducer(address);
|
||||
} catch (ActiveMQException amqEx) {
|
||||
|
|
|
@ -303,7 +303,7 @@ public class EmbeddedActiveMQDelegate implements EmbeddedActiveMQOperations {
|
|||
Queue queue = null;
|
||||
try {
|
||||
queue = server.getActiveMQServer()
|
||||
.createQueue(new QueueConfiguration(name).setAddress(address).setDurable(isUseDurableQueue()));
|
||||
.createQueue(QueueConfiguration.of(name).setAddress(address).setDurable(isUseDurableQueue()));
|
||||
} catch (Exception ex) {
|
||||
throw new EmbeddedActiveMQResourceException(String.format("Failed to create queue: queueName = %s, name = %s",
|
||||
address.toString(), name.toString()),
|
||||
|
@ -329,7 +329,7 @@ public class EmbeddedActiveMQDelegate implements EmbeddedActiveMQOperations {
|
|||
public void createSharedQueue(SimpleString address, SimpleString name, SimpleString user) {
|
||||
try {
|
||||
server.getActiveMQServer()
|
||||
.createSharedQueue(new QueueConfiguration(name).setAddress(address)
|
||||
.createSharedQueue(QueueConfiguration.of(name).setAddress(address)
|
||||
.setRoutingType(RoutingType.MULTICAST)
|
||||
.setDurable(isUseDurableQueue())
|
||||
.setUser(user));
|
||||
|
|
|
@ -317,7 +317,7 @@ public class AMQPSessionCallback implements SessionCallback {
|
|||
SimpleString filter,
|
||||
Integer maxConsumers) throws Exception {
|
||||
try {
|
||||
serverSession.createQueue(new QueueConfiguration(queueName).setAddress(address)
|
||||
serverSession.createQueue(QueueConfiguration.of(queueName).setAddress(address)
|
||||
.setRoutingType(routingType)
|
||||
.setFilterString(filter)
|
||||
.setTemporary(true)
|
||||
|
@ -333,7 +333,7 @@ public class AMQPSessionCallback implements SessionCallback {
|
|||
SimpleString queueName,
|
||||
SimpleString filter) throws Exception {
|
||||
try {
|
||||
serverSession.createQueue(new QueueConfiguration(queueName).setAddress(address).setRoutingType(routingType).setFilterString(filter).setMaxConsumers(1));
|
||||
serverSession.createQueue(QueueConfiguration.of(queueName).setAddress(address).setRoutingType(routingType).setFilterString(filter).setMaxConsumers(1));
|
||||
} catch (ActiveMQSecurityException se) {
|
||||
throw ActiveMQAMQPProtocolMessageBundle.BUNDLE.securityErrorCreatingConsumer(se.getMessage());
|
||||
}
|
||||
|
@ -344,7 +344,7 @@ public class AMQPSessionCallback implements SessionCallback {
|
|||
SimpleString queueName,
|
||||
SimpleString filter) throws Exception {
|
||||
try {
|
||||
serverSession.createSharedQueue(new QueueConfiguration(queueName).setAddress(address).setRoutingType(routingType).setFilterString(filter));
|
||||
serverSession.createSharedQueue(QueueConfiguration.of(queueName).setAddress(address).setRoutingType(routingType).setFilterString(filter));
|
||||
} catch (ActiveMQQueueExistsException alreadyExists) {
|
||||
// nothing to be done.. just ignore it. if you have many consumers all doing the same another one probably already done it
|
||||
} catch (ActiveMQSecurityException se) {
|
||||
|
@ -357,7 +357,7 @@ public class AMQPSessionCallback implements SessionCallback {
|
|||
SimpleString queueName,
|
||||
SimpleString filter) throws Exception {
|
||||
try {
|
||||
serverSession.createSharedQueue(new QueueConfiguration(queueName).setAddress(address).setRoutingType(routingType).setFilterString(filter).setDurable(false));
|
||||
serverSession.createSharedQueue(QueueConfiguration.of(queueName).setAddress(address).setRoutingType(routingType).setFilterString(filter).setDurable(false));
|
||||
} catch (ActiveMQSecurityException se) {
|
||||
throw ActiveMQAMQPProtocolMessageBundle.BUNDLE.securityErrorCreatingConsumer(se.getMessage());
|
||||
} catch (ActiveMQQueueExistsException e) {
|
||||
|
@ -395,11 +395,11 @@ public class AMQPSessionCallback implements SessionCallback {
|
|||
}
|
||||
|
||||
public QueueQueryResult queueQuery(SimpleString queueName, RoutingType routingType, boolean autoCreate, SimpleString filter) throws Exception {
|
||||
return queueQuery(new QueueConfiguration(queueName).setRoutingType(routingType).setFilterString(filter), autoCreate);
|
||||
return queueQuery(QueueConfiguration.of(queueName).setRoutingType(routingType).setFilterString(filter), autoCreate);
|
||||
}
|
||||
|
||||
public boolean checkAddressAndAutocreateIfPossible(SimpleString address, RoutingType routingType) throws Exception {
|
||||
AutoCreateResult autoCreateResult = serverSession.checkAutoCreate(new QueueConfiguration(address).setRoutingType(routingType));
|
||||
AutoCreateResult autoCreateResult = serverSession.checkAutoCreate(QueueConfiguration.of(address).setRoutingType(routingType));
|
||||
return autoCreateResult != AutoCreateResult.NOT_FOUND;
|
||||
}
|
||||
|
||||
|
|
|
@ -531,7 +531,7 @@ public class AMQPBrokerConnection implements ClientConnectionLifeCycleListener,
|
|||
Queue mirrorControlQueue = server.locateQueue(getMirrorSNF(replicaConfig));
|
||||
|
||||
if (mirrorControlQueue == null) {
|
||||
mirrorControlQueue = server.createQueue(new QueueConfiguration(getMirrorSNF(replicaConfig)).setAddress(getMirrorSNF(replicaConfig)).setRoutingType(RoutingType.ANYCAST).setDurable(replicaConfig.isDurable()).setInternal(true), true);
|
||||
mirrorControlQueue = server.createQueue(QueueConfiguration.of(getMirrorSNF(replicaConfig)).setAddress(getMirrorSNF(replicaConfig)).setRoutingType(RoutingType.ANYCAST).setDurable(replicaConfig.isDurable()).setInternal(true), true);
|
||||
}
|
||||
|
||||
try {
|
||||
|
|
|
@ -167,7 +167,7 @@ public final class AMQPFederationAddressSenderController extends AMQPFederationB
|
|||
// Recover or create the queue we use to reflect the messages sent to the address to the remote
|
||||
QueueQueryResult queueQuery = sessionSPI.queueQuery(queueName, routingType, false);
|
||||
if (!queueQuery.isExists()) {
|
||||
final QueueConfiguration configuration = new QueueConfiguration(queueName);
|
||||
final QueueConfiguration configuration = QueueConfiguration.of(queueName);
|
||||
|
||||
configuration.setAddress(address);
|
||||
configuration.setRoutingType(routingType);
|
||||
|
|
|
@ -136,7 +136,7 @@ public class MQTTPublishManager {
|
|||
private void createManagementQueue() throws Exception {
|
||||
Queue q = session.getServer().locateQueue(managementAddress);
|
||||
if (q == null) {
|
||||
session.getServer().createQueue(new QueueConfiguration(managementAddress)
|
||||
session.getServer().createQueue(QueueConfiguration.of(managementAddress)
|
||||
.setRoutingType(RoutingType.ANYCAST)
|
||||
.setDurable(MQTTUtil.DURABLE_MESSAGES));
|
||||
}
|
||||
|
|
|
@ -52,7 +52,7 @@ public class MQTTRetainMessageManager {
|
|||
|
||||
Queue queue = session.getServer().locateQueue(retainAddress);
|
||||
if (queue == null) {
|
||||
queue = session.getServer().createQueue(new QueueConfiguration(retainAddress).setAutoCreated(true));
|
||||
queue = session.getServer().createQueue(QueueConfiguration.of(retainAddress).setAutoCreated(true));
|
||||
}
|
||||
|
||||
queue.deleteAllReferences();
|
||||
|
|
|
@ -78,7 +78,7 @@ public class MQTTStateManager {
|
|||
private MQTTStateManager(ActiveMQServer server) throws Exception {
|
||||
this.server = server;
|
||||
this.timeout = server.getConfiguration().getMqttSessionStatePersistenceTimeout();
|
||||
this.sessionStore = server.createQueue(new QueueConfiguration(MQTTUtil.MQTT_SESSION_STORE).setRoutingType(RoutingType.ANYCAST).setLastValue(true).setDurable(true).setInternal(true).setAutoCreateAddress(true), true);
|
||||
this.sessionStore = server.createQueue(QueueConfiguration.of(MQTTUtil.MQTT_SESSION_STORE).setRoutingType(RoutingType.ANYCAST).setLastValue(true).setDurable(true).setInternal(true).setAutoCreateAddress(true), true);
|
||||
|
||||
// load session data from queue
|
||||
try (LinkedListIterator<MessageReference> iterator = sessionStore.browserIterator()) {
|
||||
|
|
|
@ -185,7 +185,7 @@ public class MQTTSubscriptionManager {
|
|||
*/
|
||||
boolean durable = session.getVersion() == MQTTVersion.MQTT_5 || (session.getVersion() != MQTTVersion.MQTT_5 && !session.isClean());
|
||||
if (addressInfo.getRoutingTypes().contains(RoutingType.MULTICAST)) {
|
||||
return session.getServerSession().createQueue(new QueueConfiguration(queue).setAddress(addressInfo.getName()).setFilterString(getMessageFilter(addressInfo.getName())).setDurable(durable));
|
||||
return session.getServerSession().createQueue(QueueConfiguration.of(queue).setAddress(addressInfo.getName()).setFilterString(getMessageFilter(addressInfo.getName())).setDurable(durable));
|
||||
}
|
||||
|
||||
if (addressInfo.getRoutingTypes().contains(RoutingType.ANYCAST)) {
|
||||
|
@ -201,7 +201,7 @@ public class MQTTSubscriptionManager {
|
|||
return session.getServer().locateQueue(name);
|
||||
} else {
|
||||
try {
|
||||
return session.getServerSession().createQueue(new QueueConfiguration(addressInfo.getName()).setRoutingType(RoutingType.ANYCAST).setFilterString(getMessageFilter(addressInfo.getName())).setDurable(durable));
|
||||
return session.getServerSession().createQueue(QueueConfiguration.of(addressInfo.getName()).setRoutingType(RoutingType.ANYCAST).setFilterString(getMessageFilter(addressInfo.getName())).setDurable(durable));
|
||||
} catch (ActiveMQQueueExistsException e) {
|
||||
return session.getServer().locateQueue(addressInfo.getName());
|
||||
}
|
||||
|
|
|
@ -919,7 +919,7 @@ public class OpenWireConnection extends AbstractRemotingConnection implements Se
|
|||
|
||||
SimpleString qName = SimpleString.of(dest.getPhysicalName());
|
||||
|
||||
AutoCreateResult autoCreateResult = internalSession.checkAutoCreate(new QueueConfiguration(qName)
|
||||
AutoCreateResult autoCreateResult = internalSession.checkAutoCreate(QueueConfiguration.of(qName)
|
||||
.setRoutingType(dest.isQueue() ? RoutingType.ANYCAST : RoutingType.MULTICAST)
|
||||
.setDurable(!dest.isTemporary())
|
||||
.setTemporary(dest.isTemporary()));
|
||||
|
|
|
@ -235,10 +235,10 @@ public class AMQConsumer {
|
|||
session.getCoreSession().deleteQueue(queueName);
|
||||
|
||||
// Create the new one
|
||||
session.getCoreSession().createQueue(new QueueConfiguration(queueName).setAddress(address).setFilterString(selector).setInternal(internalAddress));
|
||||
session.getCoreSession().createQueue(QueueConfiguration.of(queueName).setAddress(address).setFilterString(selector).setInternal(internalAddress));
|
||||
}
|
||||
} else {
|
||||
session.getCoreSession().createQueue(new QueueConfiguration(queueName).setAddress(address).setFilterString(selector).setInternal(internalAddress));
|
||||
session.getCoreSession().createQueue(QueueConfiguration.of(queueName).setAddress(address).setFilterString(selector).setInternal(internalAddress));
|
||||
}
|
||||
} else {
|
||||
/*
|
||||
|
@ -253,7 +253,7 @@ public class AMQConsumer {
|
|||
queueName = SimpleString.of(UUID.randomUUID().toString());
|
||||
}
|
||||
|
||||
session.getCoreSession().createQueue(new QueueConfiguration(queueName).setAddress(address).setFilterString(selector).setDurable(false).setTemporary(true).setInternal(internalAddress));
|
||||
session.getCoreSession().createQueue(QueueConfiguration.of(queueName).setAddress(address).setFilterString(selector).setDurable(false).setTemporary(true).setInternal(internalAddress));
|
||||
}
|
||||
|
||||
return queueName;
|
||||
|
|
|
@ -243,7 +243,7 @@ public class AMQSession implements SessionCallback {
|
|||
routingTypeToUse = as.getDefaultAddressRoutingType();
|
||||
}
|
||||
}
|
||||
AutoCreateResult autoCreateResult = coreSession.checkAutoCreate(new QueueConfiguration(queueName)
|
||||
AutoCreateResult autoCreateResult = coreSession.checkAutoCreate(QueueConfiguration.of(queueName)
|
||||
.setAddress(queueName)
|
||||
.setRoutingType(routingTypeToUse)
|
||||
.setTemporary(isTemporary)
|
||||
|
|
|
@ -197,7 +197,7 @@ public final class StompConnection extends AbstractRemotingConnection {
|
|||
|
||||
// auto create the queue if the address is ANYCAST or FQQN
|
||||
if ((CompositeAddress.isFullyQualified(destination) || effectiveAddressRoutingType == RoutingType.ANYCAST) && addressSettings.isAutoCreateQueues() && manager.getServer().locateQueue(simpleDestination) == null) {
|
||||
session.createQueue(new QueueConfiguration(destination).setRoutingType(effectiveAddressRoutingType).setAutoCreated(true));
|
||||
session.createQueue(QueueConfiguration.of(destination).setRoutingType(effectiveAddressRoutingType).setAutoCreated(true));
|
||||
}
|
||||
} catch (ActiveMQQueueExistsException e) {
|
||||
// ignore
|
||||
|
|
|
@ -322,14 +322,14 @@ public class StompSession implements SessionCallback {
|
|||
queueName = SimpleString.of(clientID + "." + durableSubscriptionName);
|
||||
if (manager.getServer().locateQueue(queueName) == null) {
|
||||
try {
|
||||
session.createQueue(new QueueConfiguration(queueName).setAddress(address).setFilterString(selectorSimple));
|
||||
session.createQueue(QueueConfiguration.of(queueName).setAddress(address).setFilterString(selectorSimple));
|
||||
} catch (ActiveMQQueueExistsException e) {
|
||||
// ignore; can be caused by concurrent durable subscribers
|
||||
}
|
||||
}
|
||||
} else {
|
||||
queueName = UUIDGenerator.getInstance().generateSimpleStringUUID();
|
||||
session.createQueue(new QueueConfiguration(queueName).setAddress(address).setFilterString(selectorSimple).setDurable(false).setTemporary(true));
|
||||
session.createQueue(QueueConfiguration.of(queueName).setAddress(address).setFilterString(selectorSimple).setDurable(false).setTemporary(true));
|
||||
}
|
||||
}
|
||||
final ServerConsumer consumer = session.createConsumer(consumerID, queueName, multicast ? null : selectorSimple, false, false, 0);
|
||||
|
|
|
@ -128,7 +128,7 @@ public class ActiveMQMessageHandler implements MessageHandler, FailoverEventList
|
|||
QueueQuery subResponse = session.queueQuery(queueName);
|
||||
|
||||
if (!subResponse.isExists()) {
|
||||
session.createQueue(new QueueConfiguration(queueName).setAddress(activation.getAddress()).setFilterString(selectorString));
|
||||
session.createQueue(QueueConfiguration.of(queueName).setAddress(activation.getAddress()).setFilterString(selectorString));
|
||||
} else {
|
||||
// The check for already exists should be done only at the first session
|
||||
// As a deployed MDB could set up multiple instances in order to process messages in parallel.
|
||||
|
@ -154,7 +154,7 @@ public class ActiveMQMessageHandler implements MessageHandler, FailoverEventList
|
|||
session.deleteQueue(queueName);
|
||||
|
||||
// Create the new one
|
||||
session.createQueue(new QueueConfiguration(queueName).setAddress(activation.getAddress()).setFilterString(selectorString));
|
||||
session.createQueue(QueueConfiguration.of(queueName).setAddress(activation.getAddress()).setFilterString(selectorString));
|
||||
}
|
||||
}
|
||||
consumer = (ClientConsumerInternal) session.createConsumer(queueName, null, false);
|
||||
|
@ -163,7 +163,7 @@ public class ActiveMQMessageHandler implements MessageHandler, FailoverEventList
|
|||
if (activation.isTopic()) {
|
||||
if (activation.getTopicTemporaryQueue() == null) {
|
||||
tempQueueName = SimpleString.of(UUID.randomUUID().toString());
|
||||
session.createQueue(new QueueConfiguration(tempQueueName).setAddress(activation.getAddress()).setFilterString(selectorString).setDurable(false).setTemporary(true));
|
||||
session.createQueue(QueueConfiguration.of(tempQueueName).setAddress(activation.getAddress()).setFilterString(selectorString).setDurable(false).setTemporary(true));
|
||||
activation.setTopicTemporaryQueue(tempQueueName);
|
||||
} else {
|
||||
tempQueueName = activation.getTopicTemporaryQueue();
|
||||
|
@ -171,7 +171,7 @@ public class ActiveMQMessageHandler implements MessageHandler, FailoverEventList
|
|||
if (!queueQuery.isExists()) {
|
||||
// this is because we could be using remote servers (in cluster maybe)
|
||||
// and the queue wasn't created on that node yet.
|
||||
session.createQueue(new QueueConfiguration(tempQueueName).setAddress(activation.getAddress()).setFilterString(selectorString).setDurable(false).setTemporary(true));
|
||||
session.createQueue(QueueConfiguration.of(tempQueueName).setAddress(activation.getAddress()).setFilterString(selectorString).setDurable(false).setTemporary(true));
|
||||
}
|
||||
}
|
||||
} else {
|
||||
|
|
|
@ -133,7 +133,7 @@ public class CoreQueueConfiguration implements Serializable {
|
|||
}
|
||||
|
||||
public QueueConfiguration toQueueConfiguration() {
|
||||
return new QueueConfiguration(this.getName())
|
||||
return QueueConfiguration.of(this.getName())
|
||||
.setAddress(this.getAddress())
|
||||
.setDurable(this.isDurable())
|
||||
.setRoutingType(this.getRoutingType())
|
||||
|
|
|
@ -177,7 +177,7 @@ public class LegacyJMSConfiguration implements Deployable {
|
|||
configuration.addAddressConfiguration(new CoreAddressConfiguration()
|
||||
.setName(queueName)
|
||||
.addRoutingType(RoutingType.ANYCAST)
|
||||
.addQueueConfiguration(new QueueConfiguration(queueName)
|
||||
.addQueueConfiguration(QueueConfiguration.of(queueName)
|
||||
.setFilterString(selectorString)
|
||||
.setDurable(durable)
|
||||
.setRoutingType(RoutingType.ANYCAST)));
|
||||
|
|
|
@ -1585,7 +1585,7 @@ public final class FileConfigurationParser extends XMLConfigurationUtil {
|
|||
}
|
||||
}
|
||||
|
||||
return new QueueConfiguration(name)
|
||||
return QueueConfiguration.of(name)
|
||||
.setAddress(address)
|
||||
.setFilterString(filterString)
|
||||
.setDurable(durable)
|
||||
|
|
|
@ -1037,7 +1037,7 @@ public class ActiveMQServerControlImpl extends AbstractControl implements Active
|
|||
|
||||
clearIO();
|
||||
try {
|
||||
server.createQueue(new QueueConfiguration(name).setAddress(address).setFilterString(filterStr).setDurable(durable));
|
||||
server.createQueue(QueueConfiguration.of(name).setAddress(address).setFilterString(filterStr).setDurable(durable));
|
||||
} finally {
|
||||
blockOnIO();
|
||||
}
|
||||
|
@ -1275,7 +1275,7 @@ public class ActiveMQServerControlImpl extends AbstractControl implements Active
|
|||
filter = SimpleString.of(filterStr);
|
||||
}
|
||||
|
||||
final Queue queue = server.createQueue(new QueueConfiguration(name).setAddress(address).setRoutingType(RoutingType.valueOf(routingType.toUpperCase())).setFilterString(filter).setDurable(durable).setMaxConsumers(maxConsumers).setPurgeOnNoConsumers(purgeOnNoConsumers).setExclusive(exclusive).setGroupRebalance(groupRebalance).setGroupBuckets(groupBuckets).setGroupFirstKey(groupFirstKey).setLastValue(lastValue).setLastValueKey(lastValueKey).setNonDestructive(nonDestructive).setConsumersBeforeDispatch(consumersBeforeDispatch).setDelayBeforeDispatch(delayBeforeDispatch).setAutoDelete(autoDelete).setAutoDeleteDelay(autoDeleteDelay).setAutoDeleteMessageCount(autoDeleteMessageCount).setAutoCreateAddress(autoCreateAddress).setRingSize(ringSize));
|
||||
final Queue queue = server.createQueue(QueueConfiguration.of(name).setAddress(address).setRoutingType(RoutingType.valueOf(routingType.toUpperCase())).setFilterString(filter).setDurable(durable).setMaxConsumers(maxConsumers).setPurgeOnNoConsumers(purgeOnNoConsumers).setExclusive(exclusive).setGroupRebalance(groupRebalance).setGroupBuckets(groupBuckets).setGroupFirstKey(groupFirstKey).setLastValue(lastValue).setLastValueKey(lastValueKey).setNonDestructive(nonDestructive).setConsumersBeforeDispatch(consumersBeforeDispatch).setDelayBeforeDispatch(delayBeforeDispatch).setAutoDelete(autoDelete).setAutoDeleteDelay(autoDeleteDelay).setAutoDeleteMessageCount(autoDeleteMessageCount).setAutoCreateAddress(autoCreateAddress).setRingSize(ringSize));
|
||||
if (AuditLogger.isResourceLoggingEnabled()) {
|
||||
AuditLogger.createQueueSuccess(name, address, routingType);
|
||||
}
|
||||
|
|
|
@ -607,13 +607,13 @@ public class PostOfficeImpl implements PostOffice, NotificationListener, Binding
|
|||
.setInternal(false);
|
||||
addAddressInfo(addressInfo);
|
||||
|
||||
server.createQueue(new QueueConfiguration(internalMulticastQueueName)
|
||||
server.createQueue(QueueConfiguration.of(internalMulticastQueueName)
|
||||
.setAddress(internalAddressName)
|
||||
.setRoutingType(RoutingType.MULTICAST)
|
||||
.setMaxConsumers(0)
|
||||
.setRingSize(retroactiveMessageCount));
|
||||
|
||||
server.createQueue(new QueueConfiguration(internalAnycastQueueName)
|
||||
server.createQueue(QueueConfiguration.of(internalAnycastQueueName)
|
||||
.setAddress(internalAddressName)
|
||||
.setRoutingType(RoutingType.ANYCAST)
|
||||
.setMaxConsumers(0)
|
||||
|
@ -689,7 +689,7 @@ public class PostOfficeImpl implements PostOffice, NotificationListener, Binding
|
|||
SimpleString user,
|
||||
Boolean configurationManaged,
|
||||
Long ringSize) throws Exception {
|
||||
return updateQueue(new QueueConfiguration(name)
|
||||
return updateQueue(QueueConfiguration.of(name)
|
||||
.setRoutingType(routingType)
|
||||
.setFilterString(filter.getFilterString())
|
||||
.setMaxConsumers(maxConsumers)
|
||||
|
@ -1272,7 +1272,7 @@ public class PostOfficeImpl implements PostOffice, NotificationListener, Binding
|
|||
private AddressInfo checkAddress(RoutingContext context, SimpleString address) throws Exception {
|
||||
AddressInfo addressInfo = addressManager.getAddressInfo(address);
|
||||
if (addressInfo == null && context.getServerSession() != null) {
|
||||
AutoCreateResult autoCreateResult = context.getServerSession().checkAutoCreate(new QueueConfiguration(address).setRoutingType(context.getRoutingType()));
|
||||
AutoCreateResult autoCreateResult = context.getServerSession().checkAutoCreate(QueueConfiguration.of(address).setRoutingType(context.getRoutingType()));
|
||||
if (autoCreateResult == AutoCreateResult.NOT_FOUND) {
|
||||
ActiveMQException ex = ActiveMQMessageBundle.BUNDLE.addressDoesNotExist(address);
|
||||
if (context.getTransaction() != null) {
|
||||
|
@ -1289,7 +1289,7 @@ public class PostOfficeImpl implements PostOffice, NotificationListener, Binding
|
|||
Bindings simpleRoute(SimpleString address, RoutingContext context, Message message, AddressInfo addressInfo) throws Exception {
|
||||
Bindings bindings = addressManager.getBindingsForRoutingAddress(address);
|
||||
if ((bindings == null || !bindings.hasLocalBinding()) && context.getServerSession() != null) {
|
||||
AutoCreateResult autoCreateResult = context.getServerSession().checkAutoCreate(new QueueConfiguration(address).setRoutingType(context.getRoutingType()));
|
||||
AutoCreateResult autoCreateResult = context.getServerSession().checkAutoCreate(QueueConfiguration.of(address).setRoutingType(context.getRoutingType()));
|
||||
if (autoCreateResult == AutoCreateResult.NOT_FOUND) {
|
||||
ActiveMQException e = ActiveMQMessageBundle.BUNDLE.addressDoesNotExist(address);
|
||||
Transaction tx = context.getTransaction();
|
||||
|
|
|
@ -382,7 +382,7 @@ public class ServerSessionPacketHandler implements ChannelHandler {
|
|||
case CREATE_QUEUE: {
|
||||
CreateQueueMessage request = (CreateQueueMessage) packet;
|
||||
requiresResponse = request.isRequiresResponse();
|
||||
session.createQueue(new QueueConfiguration(request.getQueueName())
|
||||
session.createQueue(QueueConfiguration.of(request.getQueueName())
|
||||
.setAddress(request.getAddress())
|
||||
.setRoutingType(getRoutingTypeFromAddress(request.getAddress()))
|
||||
.setFilterString(request.getFilterString())
|
||||
|
@ -408,7 +408,7 @@ public class ServerSessionPacketHandler implements ChannelHandler {
|
|||
requiresResponse = request.isRequiresResponse();
|
||||
QueueQueryResult result = session.executeQueueQuery(request.getQueueName());
|
||||
if (!(result.isExists() && Objects.equals(result.getAddress(), request.getAddress()) && Objects.equals(result.getFilterString(), request.getFilterString()))) {
|
||||
session.createSharedQueue(new QueueConfiguration(request.getQueueName())
|
||||
session.createSharedQueue(QueueConfiguration.of(request.getQueueName())
|
||||
.setAddress(request.getAddress())
|
||||
.setFilterString(request.getFilterString())
|
||||
.setDurable(request.isDurable()));
|
||||
|
|
|
@ -275,7 +275,7 @@ public class ActiveMQPacketHandler implements ChannelHandler {
|
|||
|
||||
private void handleCreateQueue(final CreateQueueMessage request) {
|
||||
try {
|
||||
server.createQueue(new QueueConfiguration(request.getQueueName())
|
||||
server.createQueue(QueueConfiguration.of(request.getQueueName())
|
||||
.setAddress(request.getAddress())
|
||||
.setFilterString(request.getFilterString())
|
||||
.setDurable(request.isDurable())
|
||||
|
|
|
@ -281,7 +281,7 @@ public class ClusterConnectionBridge extends BridgeImpl {
|
|||
createPermissiveManagementNotificationToFilter() +
|
||||
")");
|
||||
|
||||
sessionConsumer.createQueue(new QueueConfiguration(notifQueueName)
|
||||
sessionConsumer.createQueue(QueueConfiguration.of(notifQueueName)
|
||||
.setAddress(managementNotificationAddress)
|
||||
.setFilterString(filter)
|
||||
.setDurable(false)
|
||||
|
|
|
@ -802,7 +802,7 @@ public final class ClusterConnectionImpl implements ClusterConnection, AfterConn
|
|||
} else {
|
||||
// Add binding in storage so the queue will get reloaded on startup and we can find it - it's never
|
||||
// actually routed to at that address though
|
||||
queue = server.createQueue(new QueueConfiguration(queueName).setRoutingType(RoutingType.MULTICAST).setAutoCreateAddress(true).setMaxConsumers(-1).setPurgeOnNoConsumers(false).setInternal(true));
|
||||
queue = server.createQueue(QueueConfiguration.of(queueName).setRoutingType(RoutingType.MULTICAST).setAutoCreateAddress(true).setMaxConsumers(-1).setPurgeOnNoConsumers(false).setInternal(true));
|
||||
}
|
||||
|
||||
// There are a few things that will behave differently when it's an internal queue
|
||||
|
|
|
@ -294,7 +294,7 @@ public class FederatedAddress extends FederatedAbstract implements ActiveMQServe
|
|||
|
||||
private void createRemoteQueue(ClientSession clientSession, FederatedConsumerKey key) throws ActiveMQException {
|
||||
if (!clientSession.queueQuery(key.getQueueName()).isExists()) {
|
||||
clientSession.createQueue(new QueueConfiguration(key.getQueueName())
|
||||
clientSession.createQueue(QueueConfiguration.of(key.getQueueName())
|
||||
.setAddress(key.getAddress())
|
||||
.setRoutingType(key.getRoutingType())
|
||||
.setFilterString(key.getQueueFilterString())
|
||||
|
|
|
@ -2335,7 +2335,7 @@ public class ActiveMQServerImpl implements ActiveMQServer {
|
|||
boolean autoDelete,
|
||||
long autoDeleteDelay,
|
||||
long autoDeleteMessageCount) throws Exception {
|
||||
createSharedQueue(new QueueConfiguration(name)
|
||||
createSharedQueue(QueueConfiguration.of(name)
|
||||
.setAddress(address)
|
||||
.setRoutingType(routingType)
|
||||
.setFilterString(filterString)
|
||||
|
@ -4067,7 +4067,7 @@ public class ActiveMQServerImpl implements ActiveMQServer {
|
|||
final boolean autoCreateAddress,
|
||||
final boolean configurationManaged,
|
||||
final long ringSize) throws Exception {
|
||||
return createQueue(new QueueConfiguration(queueName)
|
||||
return createQueue(QueueConfiguration.of(queueName)
|
||||
.setAddress(addrInfo == null ? null : addrInfo.getName())
|
||||
.setRoutingType(addrInfo == null ? null : addrInfo.getRoutingType())
|
||||
.setFilterString(filterString)
|
||||
|
@ -4395,7 +4395,7 @@ public class ActiveMQServerImpl implements ActiveMQServer {
|
|||
Long delayBeforeDispatch,
|
||||
String user,
|
||||
Long ringSize) throws Exception {
|
||||
return updateQueue(new QueueConfiguration(name)
|
||||
return updateQueue(QueueConfiguration.of(name)
|
||||
.setRoutingType(routingType)
|
||||
.setFilterString(filterString)
|
||||
.setMaxConsumers(maxConsumers)
|
||||
|
|
|
@ -89,7 +89,7 @@ public class LastValueQueue extends QueueImpl {
|
|||
final ArtemisExecutor executor,
|
||||
final ActiveMQServer server,
|
||||
final QueueFactory factory) {
|
||||
this(new QueueConfiguration(name)
|
||||
this(QueueConfiguration.of(name)
|
||||
.setId(persistenceID)
|
||||
.setAddress(address)
|
||||
.setFilterString(filter.getFilterString())
|
||||
|
|
|
@ -138,7 +138,7 @@ public class PostOfficeJournalLoader implements JournalLoader {
|
|||
}
|
||||
}
|
||||
|
||||
final Queue queue = queueFactory.createQueueWith(new QueueConfiguration(queueBindingInfo.getQueueName())
|
||||
final Queue queue = queueFactory.createQueueWith(QueueConfiguration.of(queueBindingInfo.getQueueName())
|
||||
.setId(queueBindingInfo.getId())
|
||||
.setAddress(queueBindingInfo.getAddress())
|
||||
.setFilterString(queueBindingInfo.getFilterString())
|
||||
|
|
|
@ -606,7 +606,7 @@ public class QueueImpl extends CriticalComponentImpl implements Queue {
|
|||
final ArtemisExecutor executor,
|
||||
final ActiveMQServer server,
|
||||
final QueueFactory factory) {
|
||||
this(new QueueConfiguration(name)
|
||||
this(QueueConfiguration.of(name)
|
||||
.setId(id)
|
||||
.setAddress(address)
|
||||
.setFilterString(filter == null ? null : filter.getFilterString())
|
||||
|
@ -3965,7 +3965,7 @@ public class QueueImpl extends CriticalComponentImpl implements Queue {
|
|||
SimpleString destinationQueueName = prefix.concat(getAddress()).concat(suffix);
|
||||
SimpleString filter = SimpleString.of(String.format("%s = '%s'", Message.HDR_ORIGINAL_ADDRESS, getAddress()));
|
||||
try {
|
||||
server.createQueue(new QueueConfiguration(destinationQueueName).setAddress(destinationAddress).setFilterString(filter).setAutoCreated(true).setAutoCreateAddress(true), true);
|
||||
server.createQueue(QueueConfiguration.of(destinationQueueName).setAddress(destinationAddress).setFilterString(filter).setAutoCreated(true).setAutoCreateAddress(true), true);
|
||||
} catch (ActiveMQQueueExistsException e) {
|
||||
// ignore
|
||||
}
|
||||
|
@ -4343,7 +4343,7 @@ public class QueueImpl extends CriticalComponentImpl implements Queue {
|
|||
|
||||
@Override
|
||||
public QueueConfiguration getQueueConfiguration() {
|
||||
return new QueueConfiguration(name)
|
||||
return QueueConfiguration.of(name)
|
||||
.setAddress(address)
|
||||
.setId(id)
|
||||
.setRoutingType(routingType)
|
||||
|
|
|
@ -447,7 +447,7 @@ public class ScaleDownHandler {
|
|||
RoutingType routingType) throws Exception {
|
||||
long queueID = getQueueID(session, queue.getName());
|
||||
if (queueID == -1) {
|
||||
session.createQueue(new QueueConfiguration(queue.getName()).setAddress(addressName).setRoutingType(routingType).setFilterString(queue.getFilter() == null ? null : queue.getFilter().getFilterString()).setDurable(queue.isDurable()));
|
||||
session.createQueue(QueueConfiguration.of(queue.getName()).setAddress(addressName).setRoutingType(routingType).setFilterString(queue.getFilter() == null ? null : queue.getFilter().getFilterString()).setDurable(queue.isDurable()));
|
||||
if (logger.isDebugEnabled()) {
|
||||
logger.debug("Failed to get queue ID, creating queue [addressName={}, queueName={}, routingType={}, filter={}, durable={}]",
|
||||
addressName, queue.getName(), queue.getRoutingType(), (queue.getFilter() == null ? "" : queue.getFilter().getFilterString()), queue.isDurable());
|
||||
|
|
|
@ -712,7 +712,7 @@ public class ServerSessionImpl implements ServerSession, FailureListener {
|
|||
final long autoDeleteMessageCount,
|
||||
final boolean autoCreated,
|
||||
final long ringSize) throws Exception {
|
||||
return createQueue(new QueueConfiguration(name)
|
||||
return createQueue(QueueConfiguration.of(name)
|
||||
.setAddress(addressInfo.getName())
|
||||
.setRoutingType(addressInfo.getRoutingType())
|
||||
.setFilterString(filterString)
|
||||
|
@ -1041,7 +1041,7 @@ public class ServerSessionImpl implements ServerSession, FailureListener {
|
|||
Boolean autoDelete,
|
||||
Long autoDeleteDelay,
|
||||
Long autoDeleteMessageCount) throws Exception {
|
||||
createSharedQueue(new QueueConfiguration(name)
|
||||
createSharedQueue(QueueConfiguration.of(name)
|
||||
.setAddress(address)
|
||||
.setFilterString(filterString)
|
||||
.setUser(getUsername())
|
||||
|
@ -1855,7 +1855,7 @@ public class ServerSessionImpl implements ServerSession, FailureListener {
|
|||
} else if (addressSettings.isAutoCreateQueues() || queueConfig.isTemporary()) {
|
||||
// Try to create the queue.
|
||||
try {
|
||||
createQueue(new QueueConfiguration(queueConfig).setAutoCreated(true));
|
||||
createQueue(QueueConfiguration.of(queueConfig).setAutoCreated(true));
|
||||
} catch (ActiveMQQueueExistsException e) {
|
||||
// The queue may have been created by another thread in the mean-time. Catch and do nothing.
|
||||
}
|
||||
|
|
|
@ -47,7 +47,7 @@ ServerLocator serverLocator = ActiveMQClient.createServerLocator("vm://0");
|
|||
ClientSessionFactory factory = serverLocator.createSessionFactory();
|
||||
ClientSession session = factory.createSession();
|
||||
|
||||
session.createQueue(new QueueConfiguration("example"));
|
||||
session.createQueue(QueueConfiguration.of("example"));
|
||||
|
||||
ClientProducer producer = session.createProducer("example");
|
||||
ClientMessage message = session.createMessage(true);
|
||||
|
|
|
@ -262,7 +262,7 @@ public class ArtemisBrokerWrapper extends ArtemisBrokerBase {
|
|||
if (coreQ == null) {
|
||||
coreQ = SimpleString.of(qname);
|
||||
try {
|
||||
this.server.createQueue(new QueueConfiguration(coreQ).setDurable(false));
|
||||
this.server.createQueue(QueueConfiguration.of(coreQ).setDurable(false));
|
||||
testQueues.put(qname, coreQ);
|
||||
} catch (ActiveMQQueueExistsException e) {
|
||||
//ignore
|
||||
|
|
|
@ -262,7 +262,7 @@ public abstract class MultiThreadRandomReattachTestBase extends MultiThreadReatt
|
|||
|
||||
ClientSession session = addClientSession(sf.createSession(false, true, true));
|
||||
|
||||
session.createQueue(new QueueConfiguration(subName).setAddress(ADDRESS).setDurable(false));
|
||||
session.createQueue(QueueConfiguration.of(subName).setAddress(ADDRESS).setDurable(false));
|
||||
|
||||
ClientProducer producer = session.createProducer(ADDRESS);
|
||||
|
||||
|
@ -318,7 +318,7 @@ public abstract class MultiThreadRandomReattachTestBase extends MultiThreadReatt
|
|||
|
||||
sessConsume.start();
|
||||
|
||||
sessConsume.createQueue(new QueueConfiguration(subName).setAddress(ADDRESS).setDurable(false));
|
||||
sessConsume.createQueue(QueueConfiguration.of(subName).setAddress(ADDRESS).setDurable(false));
|
||||
|
||||
ClientConsumer consumer = sessConsume.createConsumer(subName);
|
||||
|
||||
|
@ -394,7 +394,7 @@ public abstract class MultiThreadRandomReattachTestBase extends MultiThreadReatt
|
|||
|
||||
ClientSession sessConsume = createAutoCommitSession(sf);
|
||||
|
||||
sessConsume.createQueue(new QueueConfiguration(subName).setAddress(ADDRESS).setDurable(false));
|
||||
sessConsume.createQueue(QueueConfiguration.of(subName).setAddress(ADDRESS).setDurable(false));
|
||||
|
||||
ClientConsumer consumer = sessConsume.createConsumer(subName);
|
||||
|
||||
|
@ -478,7 +478,7 @@ public abstract class MultiThreadRandomReattachTestBase extends MultiThreadReatt
|
|||
|
||||
sessConsume.start();
|
||||
|
||||
sessConsume.createQueue(new QueueConfiguration(subName).setAddress(ADDRESS).setDurable(false));
|
||||
sessConsume.createQueue(QueueConfiguration.of(subName).setAddress(ADDRESS).setDurable(false));
|
||||
|
||||
ClientConsumer consumer = sessConsume.createConsumer(subName);
|
||||
|
||||
|
@ -577,7 +577,7 @@ public abstract class MultiThreadRandomReattachTestBase extends MultiThreadReatt
|
|||
ClientSession sessConsume = sf.createSession(false, false, false);
|
||||
sessConsume.addMetaData("data", RandomUtil.randomString());
|
||||
|
||||
sessConsume.createQueue(new QueueConfiguration(subName).setAddress(ADDRESS).setDurable(false));
|
||||
sessConsume.createQueue(QueueConfiguration.of(subName).setAddress(ADDRESS).setDurable(false));
|
||||
|
||||
ClientConsumer consumer = sessConsume.createConsumer(subName);
|
||||
|
||||
|
@ -706,7 +706,7 @@ public abstract class MultiThreadRandomReattachTestBase extends MultiThreadReatt
|
|||
|
||||
sessConsume.start();
|
||||
|
||||
sessConsume.createQueue(new QueueConfiguration(subName).setAddress(ADDRESS).setDurable(false));
|
||||
sessConsume.createQueue(QueueConfiguration.of(subName).setAddress(ADDRESS).setDurable(false));
|
||||
|
||||
ClientConsumer consumer = sessConsume.createConsumer(subName);
|
||||
|
||||
|
@ -761,7 +761,7 @@ public abstract class MultiThreadRandomReattachTestBase extends MultiThreadReatt
|
|||
ClientSession sessConsume = sf.createSession(false, true, true);
|
||||
sessConsume.addMetaData("data", RandomUtil.randomString());
|
||||
|
||||
sessConsume.createQueue(new QueueConfiguration(subName).setAddress(ADDRESS).setDurable(false));
|
||||
sessConsume.createQueue(QueueConfiguration.of(subName).setAddress(ADDRESS).setDurable(false));
|
||||
|
||||
ClientConsumer consumer = sessConsume.createConsumer(subName);
|
||||
|
||||
|
@ -822,7 +822,7 @@ public abstract class MultiThreadRandomReattachTestBase extends MultiThreadReatt
|
|||
|
||||
sessConsume.start();
|
||||
|
||||
sessConsume.createQueue(new QueueConfiguration(subName).setAddress(ADDRESS).setDurable(false));
|
||||
sessConsume.createQueue(QueueConfiguration.of(subName).setAddress(ADDRESS).setDurable(false));
|
||||
|
||||
ClientConsumer consumer = sessConsume.createConsumer(subName);
|
||||
|
||||
|
@ -893,7 +893,7 @@ public abstract class MultiThreadRandomReattachTestBase extends MultiThreadReatt
|
|||
ClientSession sessConsume = sf.createSession(false, false, false);
|
||||
sessConsume.addMetaData("data", RandomUtil.randomString());
|
||||
|
||||
sessConsume.createQueue(new QueueConfiguration(subName).setAddress(ADDRESS).setDurable(false));
|
||||
sessConsume.createQueue(QueueConfiguration.of(subName).setAddress(ADDRESS).setDurable(false));
|
||||
|
||||
ClientConsumer consumer = sessConsume.createConsumer(subName);
|
||||
|
||||
|
@ -953,7 +953,7 @@ public abstract class MultiThreadRandomReattachTestBase extends MultiThreadReatt
|
|||
ClientSession sessCreate = sf.createSession(false, true, true);
|
||||
sessCreate.addMetaData("data", RandomUtil.randomString());
|
||||
|
||||
sessCreate.createQueue(new QueueConfiguration(SimpleString.of(threadNum + ADDRESS.toString())).setAddress(ADDRESS).setDurable(false));
|
||||
sessCreate.createQueue(QueueConfiguration.of(SimpleString.of(threadNum + ADDRESS.toString())).setAddress(ADDRESS).setDurable(false));
|
||||
|
||||
ClientSession sess = sf.createSession(false, true, true);
|
||||
sess.addMetaData("data", RandomUtil.randomString());
|
||||
|
@ -984,7 +984,7 @@ public abstract class MultiThreadRandomReattachTestBase extends MultiThreadReatt
|
|||
ClientSession sessCreate = sf.createSession(false, true, true);
|
||||
sessCreate.addMetaData("data", RandomUtil.randomString());
|
||||
|
||||
sessCreate.createQueue(new QueueConfiguration(SimpleString.of(threadNum + ADDRESS.toString())).setAddress(ADDRESS).setDurable(false));
|
||||
sessCreate.createQueue(QueueConfiguration.of(SimpleString.of(threadNum + ADDRESS.toString())).setAddress(ADDRESS).setDurable(false));
|
||||
|
||||
ClientSession sess = sf.createSession(false, true, true);
|
||||
sess.addMetaData("data", RandomUtil.randomString());
|
||||
|
@ -1015,7 +1015,7 @@ public abstract class MultiThreadRandomReattachTestBase extends MultiThreadReatt
|
|||
ClientSession s = sf.createSession(false, false, false);
|
||||
s.addMetaData("data", RandomUtil.randomString());
|
||||
|
||||
s.createQueue(new QueueConfiguration(SimpleString.of(threadNum + ADDRESS.toString())).setAddress(ADDRESS).setDurable(false));
|
||||
s.createQueue(QueueConfiguration.of(SimpleString.of(threadNum + ADDRESS.toString())).setAddress(ADDRESS).setDurable(false));
|
||||
|
||||
final int numConsumers = 100;
|
||||
|
||||
|
@ -1048,7 +1048,7 @@ public abstract class MultiThreadRandomReattachTestBase extends MultiThreadReatt
|
|||
protected void doTestN(final ClientSessionFactory sf, final int threadNum) throws Exception {
|
||||
ClientSession sessCreate = sf.createSession(false, true, true);
|
||||
|
||||
sessCreate.createQueue(new QueueConfiguration(SimpleString.of(threadNum + ADDRESS.toString())).setAddress(ADDRESS).setDurable(false));
|
||||
sessCreate.createQueue(QueueConfiguration.of(SimpleString.of(threadNum + ADDRESS.toString())).setAddress(ADDRESS).setDurable(false));
|
||||
|
||||
ClientSession sess = sf.createSession(false, true, true);
|
||||
sess.addMetaData("data", RandomUtil.randomString());
|
||||
|
@ -1088,7 +1088,7 @@ public abstract class MultiThreadRandomReattachTestBase extends MultiThreadReatt
|
|||
protected void doTestO(final ClientSessionFactory sf, final int threadNum) throws Exception {
|
||||
ClientSession sessCreate = sf.createSession(false, true, true);
|
||||
|
||||
sessCreate.createQueue(new QueueConfiguration(SimpleString.of(threadNum + ADDRESS.toString())).setAddress(ADDRESS).setDurable(false));
|
||||
sessCreate.createQueue(QueueConfiguration.of(SimpleString.of(threadNum + ADDRESS.toString())).setAddress(ADDRESS).setDurable(false));
|
||||
|
||||
ClientSession sess = sf.createSession(false, true, true);
|
||||
|
||||
|
|
|
@ -243,7 +243,7 @@ public abstract class RandomReattachTestBase extends ActiveMQTestBase {
|
|||
|
||||
sessConsume.start();
|
||||
|
||||
sessConsume.createQueue(new QueueConfiguration(subName).setAddress(ADDRESS).setDurable(false));
|
||||
sessConsume.createQueue(QueueConfiguration.of(subName).setAddress(ADDRESS).setDurable(false));
|
||||
|
||||
ClientConsumer consumer = sessConsume.createConsumer(subName);
|
||||
|
||||
|
@ -343,7 +343,7 @@ public abstract class RandomReattachTestBase extends ActiveMQTestBase {
|
|||
|
||||
ClientSession sessConsume = sf.createSession(false, true, true);
|
||||
|
||||
sessConsume.createQueue(new QueueConfiguration(subName).setAddress(ADDRESS).setDurable(false));
|
||||
sessConsume.createQueue(QueueConfiguration.of(subName).setAddress(ADDRESS).setDurable(false));
|
||||
|
||||
ClientConsumer consumer = sessConsume.createConsumer(subName);
|
||||
|
||||
|
@ -445,7 +445,7 @@ public abstract class RandomReattachTestBase extends ActiveMQTestBase {
|
|||
|
||||
sessConsume.start();
|
||||
|
||||
sessConsume.createQueue(new QueueConfiguration(subName).setAddress(ADDRESS).setDurable(false));
|
||||
sessConsume.createQueue(QueueConfiguration.of(subName).setAddress(ADDRESS).setDurable(false));
|
||||
|
||||
ClientConsumer consumer = sessConsume.createConsumer(subName);
|
||||
|
||||
|
@ -583,7 +583,7 @@ public abstract class RandomReattachTestBase extends ActiveMQTestBase {
|
|||
|
||||
ClientSession sessConsume = sf.createSession(false, false, false);
|
||||
|
||||
sessConsume.createQueue(new QueueConfiguration(subName).setAddress(ADDRESS).setDurable(false));
|
||||
sessConsume.createQueue(QueueConfiguration.of(subName).setAddress(ADDRESS).setDurable(false));
|
||||
|
||||
ClientConsumer consumer = sessConsume.createConsumer(subName);
|
||||
|
||||
|
@ -722,7 +722,7 @@ public abstract class RandomReattachTestBase extends ActiveMQTestBase {
|
|||
|
||||
sessConsume.start();
|
||||
|
||||
sessConsume.createQueue(new QueueConfiguration(subName).setAddress(ADDRESS).setDurable(false));
|
||||
sessConsume.createQueue(QueueConfiguration.of(subName).setAddress(ADDRESS).setDurable(false));
|
||||
|
||||
ClientConsumer consumer = sessConsume.createConsumer(subName);
|
||||
|
||||
|
@ -796,7 +796,7 @@ public abstract class RandomReattachTestBase extends ActiveMQTestBase {
|
|||
|
||||
ClientSession sessConsume = sf.createSession(false, true, true);
|
||||
|
||||
sessConsume.createQueue(new QueueConfiguration(subName).setAddress(ADDRESS).setDurable(false));
|
||||
sessConsume.createQueue(QueueConfiguration.of(subName).setAddress(ADDRESS).setDurable(false));
|
||||
|
||||
ClientConsumer consumer = sessConsume.createConsumer(subName);
|
||||
|
||||
|
@ -882,7 +882,7 @@ public abstract class RandomReattachTestBase extends ActiveMQTestBase {
|
|||
|
||||
sessConsume.start();
|
||||
|
||||
sessConsume.createQueue(new QueueConfiguration(subName).setAddress(ADDRESS).setDurable(false));
|
||||
sessConsume.createQueue(QueueConfiguration.of(subName).setAddress(ADDRESS).setDurable(false));
|
||||
|
||||
ClientConsumer consumer = sessConsume.createConsumer(subName);
|
||||
|
||||
|
@ -992,7 +992,7 @@ public abstract class RandomReattachTestBase extends ActiveMQTestBase {
|
|||
|
||||
ClientSession sessConsume = sf.createSession(false, false, false);
|
||||
|
||||
sessConsume.createQueue(new QueueConfiguration(subName).setAddress(ADDRESS).setDurable(false));
|
||||
sessConsume.createQueue(QueueConfiguration.of(subName).setAddress(ADDRESS).setDurable(false));
|
||||
|
||||
ClientConsumer consumer = sessConsume.createConsumer(subName);
|
||||
|
||||
|
@ -1094,7 +1094,7 @@ public abstract class RandomReattachTestBase extends ActiveMQTestBase {
|
|||
protected void doTestI(final ClientSessionFactory sf) throws Exception {
|
||||
ClientSession sessCreate = sf.createSession(false, true, true);
|
||||
|
||||
sessCreate.createQueue(new QueueConfiguration(ADDRESS).setDurable(false));
|
||||
sessCreate.createQueue(QueueConfiguration.of(ADDRESS).setDurable(false));
|
||||
|
||||
ClientSession sess = sf.createSession(false, true, true);
|
||||
|
||||
|
@ -1123,7 +1123,7 @@ public abstract class RandomReattachTestBase extends ActiveMQTestBase {
|
|||
protected void doTestJ(final ClientSessionFactory sf) throws Exception {
|
||||
ClientSession sessCreate = sf.createSession(false, true, true);
|
||||
|
||||
sessCreate.createQueue(new QueueConfiguration(ADDRESS).setDurable(false));
|
||||
sessCreate.createQueue(QueueConfiguration.of(ADDRESS).setDurable(false));
|
||||
|
||||
ClientSession sess = sf.createSession(false, true, true);
|
||||
|
||||
|
@ -1152,7 +1152,7 @@ public abstract class RandomReattachTestBase extends ActiveMQTestBase {
|
|||
protected void doTestK(final ClientSessionFactory sf) throws Exception {
|
||||
ClientSession s = sf.createSession(false, false, false);
|
||||
|
||||
s.createQueue(new QueueConfiguration(ADDRESS).setDurable(false));
|
||||
s.createQueue(QueueConfiguration.of(ADDRESS).setDurable(false));
|
||||
|
||||
final int numConsumers = 100;
|
||||
|
||||
|
@ -1180,7 +1180,7 @@ public abstract class RandomReattachTestBase extends ActiveMQTestBase {
|
|||
protected void doTestN(final ClientSessionFactory sf) throws Exception {
|
||||
ClientSession sessCreate = sf.createSession(false, true, true);
|
||||
|
||||
sessCreate.createQueue(new QueueConfiguration(SimpleString.of(ADDRESS.toString())).setAddress(ADDRESS).setDurable(false));
|
||||
sessCreate.createQueue(QueueConfiguration.of(ADDRESS).setDurable(false));
|
||||
|
||||
ClientSession sess = sf.createSession(false, true, true);
|
||||
|
||||
|
@ -1190,7 +1190,7 @@ public abstract class RandomReattachTestBase extends ActiveMQTestBase {
|
|||
|
||||
sess.stop();
|
||||
|
||||
ClientConsumer consumer = sess.createConsumer(SimpleString.of(ADDRESS.toString()));
|
||||
ClientConsumer consumer = sess.createConsumer(ADDRESS);
|
||||
|
||||
ClientProducer producer = sess.createProducer(ADDRESS);
|
||||
|
||||
|
|
|
@ -161,7 +161,7 @@ public abstract class LargeMessageTestBase extends ActiveMQTestBase {
|
|||
session.start(xid, XAResource.TMNOFLAGS);
|
||||
}
|
||||
|
||||
session.createQueue(new QueueConfiguration(ADDRESS));
|
||||
session.createQueue(QueueConfiguration.of(ADDRESS));
|
||||
|
||||
ClientProducer producer = session.createProducer(ADDRESS);
|
||||
|
||||
|
|
|
@ -1616,7 +1616,7 @@ public abstract class ActiveMQTestBase extends ArtemisTestCase {
|
|||
|
||||
protected void createAnycastPair(ActiveMQServer server, String queueName) throws Exception {
|
||||
server.addAddressInfo(new AddressInfo(queueName).addRoutingType(RoutingType.ANYCAST).setAutoCreated(false));
|
||||
server.createQueue(new QueueConfiguration(queueName).setRoutingType(RoutingType.ANYCAST).setAddress(queueName));
|
||||
server.createQueue(QueueConfiguration.of(queueName).setRoutingType(RoutingType.ANYCAST).setAddress(queueName));
|
||||
}
|
||||
|
||||
protected void createQueue(final String address, final String queue) throws Exception {
|
||||
|
@ -1624,7 +1624,7 @@ public abstract class ActiveMQTestBase extends ArtemisTestCase {
|
|||
ClientSessionFactory sf = locator.createSessionFactory();
|
||||
ClientSession session = sf.createSession();
|
||||
try {
|
||||
session.createQueue(new QueueConfiguration(queue).setAddress(address));
|
||||
session.createQueue(QueueConfiguration.of(queue).setAddress(address));
|
||||
} finally {
|
||||
session.close();
|
||||
closeSessionFactory(sf);
|
||||
|
|
|
@ -54,10 +54,10 @@ public class OldOpenWireTest extends ClasspathBase {
|
|||
server.setConfiguration(configuration);
|
||||
server.start();
|
||||
server.getActiveMQServer().addAddressInfo(new AddressInfo("Test").addRoutingType(RoutingType.ANYCAST));
|
||||
server.getActiveMQServer().createQueue(new QueueConfiguration("Test").setDurable(true).setRoutingType(RoutingType.ANYCAST));
|
||||
server.getActiveMQServer().createQueue(QueueConfiguration.of("Test").setDurable(true).setRoutingType(RoutingType.ANYCAST));
|
||||
|
||||
server.getActiveMQServer().addAddressInfo(new AddressInfo("DLQ").addRoutingType(RoutingType.ANYCAST));
|
||||
server.getActiveMQServer().createQueue(new QueueConfiguration("DLQ").setDurable(true).setRoutingType(RoutingType.ANYCAST));
|
||||
server.getActiveMQServer().createQueue(QueueConfiguration.of("DLQ").setDurable(true).setRoutingType(RoutingType.ANYCAST));
|
||||
|
||||
server.getActiveMQServer().getAddressSettingsRepository().addMatch("#", new AddressSettings().setDeadLetterAddress(SimpleString.of("DLQ")));
|
||||
}
|
||||
|
|
|
@ -78,7 +78,7 @@ public class GlobalPagingTest extends ParameterDBTestBase {
|
|||
server.start();
|
||||
String addressName = "Q" + RandomUtil.randomString();
|
||||
server.addAddressInfo(new AddressInfo(addressName).addRoutingType(RoutingType.ANYCAST));
|
||||
server.createQueue(new QueueConfiguration(addressName).setRoutingType(RoutingType.ANYCAST).setDurable(true));
|
||||
server.createQueue(QueueConfiguration.of(addressName).setRoutingType(RoutingType.ANYCAST).setDurable(true));
|
||||
|
||||
ConnectionFactory cf = CFUtil.createConnectionFactory("core", "tcp://localhost:61616");
|
||||
try (Connection connection = cf.createConnection()) {
|
||||
|
@ -115,7 +115,7 @@ public class GlobalPagingTest extends ParameterDBTestBase {
|
|||
server.start();
|
||||
String addressName = "Q" + RandomUtil.randomString();
|
||||
server.addAddressInfo(new AddressInfo(addressName).addRoutingType(RoutingType.ANYCAST));
|
||||
server.createQueue(new QueueConfiguration(addressName).setRoutingType(RoutingType.ANYCAST).setDurable(true));
|
||||
server.createQueue(QueueConfiguration.of(addressName).setRoutingType(RoutingType.ANYCAST).setDurable(true));
|
||||
|
||||
ConnectionFactory cf = CFUtil.createConnectionFactory("core", "tcp://localhost:61616");
|
||||
try (Connection connection = cf.createConnection()) {
|
||||
|
@ -152,7 +152,7 @@ public class GlobalPagingTest extends ParameterDBTestBase {
|
|||
server.start();
|
||||
String addressName = "Q" + RandomUtil.randomString();
|
||||
server.addAddressInfo(new AddressInfo(addressName).addRoutingType(RoutingType.ANYCAST));
|
||||
server.createQueue(new QueueConfiguration(addressName).setRoutingType(RoutingType.ANYCAST).setDurable(true));
|
||||
server.createQueue(QueueConfiguration.of(addressName).setRoutingType(RoutingType.ANYCAST).setDurable(true));
|
||||
|
||||
ConnectionFactory cf = CFUtil.createConnectionFactory("core", "tcp://localhost:61616");
|
||||
try (Connection connection = cf.createConnection()) {
|
||||
|
@ -191,7 +191,7 @@ public class GlobalPagingTest extends ParameterDBTestBase {
|
|||
server.start();
|
||||
String addressName = "Q" + RandomUtil.randomString();
|
||||
server.addAddressInfo(new AddressInfo(addressName).addRoutingType(RoutingType.ANYCAST));
|
||||
server.createQueue(new QueueConfiguration(addressName).setRoutingType(RoutingType.ANYCAST).setDurable(true));
|
||||
server.createQueue(QueueConfiguration.of(addressName).setRoutingType(RoutingType.ANYCAST).setDurable(true));
|
||||
|
||||
ConnectionFactory cf = CFUtil.createConnectionFactory("core", "tcp://localhost:61616");
|
||||
try (Connection connection = cf.createConnection()) {
|
||||
|
|
|
@ -72,7 +72,7 @@ public class NetworkTimeoutCheckTest extends ParameterDBTestBase {
|
|||
|
||||
|
||||
server.addAddressInfo(new AddressInfo(getName()).addRoutingType(RoutingType.ANYCAST));
|
||||
Queue queue = server.createQueue(new QueueConfiguration(getName()).setRoutingType(RoutingType.ANYCAST).setDurable(true));
|
||||
Queue queue = server.createQueue(QueueConfiguration.of(getName()).setRoutingType(RoutingType.ANYCAST).setDurable(true));
|
||||
queue.getPagingStore().startPaging();
|
||||
PagingStoreImpl store = (PagingStoreImpl) queue.getPagingStore();
|
||||
Page page = store.getCurrentPage();
|
||||
|
|
|
@ -79,7 +79,7 @@ public class PageSizeTest extends ParameterDBTestBase {
|
|||
server.start();
|
||||
String addressName = "Q" + RandomUtil.randomString();
|
||||
server.addAddressInfo(new AddressInfo(addressName).addRoutingType(RoutingType.ANYCAST));
|
||||
server.createQueue(new QueueConfiguration(addressName).setRoutingType(RoutingType.ANYCAST).setDurable(true));
|
||||
server.createQueue(QueueConfiguration.of(addressName).setRoutingType(RoutingType.ANYCAST).setDurable(true));
|
||||
|
||||
ConnectionFactory cf = CFUtil.createConnectionFactory("core", "tcp://localhost:61616");
|
||||
try (Connection connection = cf.createConnection()) {
|
||||
|
|
|
@ -197,8 +197,8 @@ public class PagingTest extends ParameterDBTestBase {
|
|||
|
||||
ClientSession session = sf.createSession(null, null, false, false, false, false, 0);
|
||||
|
||||
session.createQueue(new QueueConfiguration(ADDRESS.concat("-0")).setAddress(ADDRESS));
|
||||
session.createQueue(new QueueConfiguration(ADDRESS.concat("-1")).setAddress(ADDRESS));
|
||||
session.createQueue(QueueConfiguration.of(ADDRESS.concat("-0")).setAddress(ADDRESS));
|
||||
session.createQueue(QueueConfiguration.of(ADDRESS.concat("-1")).setAddress(ADDRESS));
|
||||
|
||||
ClientProducer producer = session.createProducer(ADDRESS);
|
||||
|
||||
|
@ -278,7 +278,7 @@ public class PagingTest extends ParameterDBTestBase {
|
|||
|
||||
ClientSession session = sf.createSession(null, null, false, false, false, false, 0);
|
||||
|
||||
session.createQueue(new QueueConfiguration(ADDRESS.concat("-0")).setAddress(ADDRESS));
|
||||
session.createQueue(QueueConfiguration.of(ADDRESS.concat("-0")).setAddress(ADDRESS));
|
||||
|
||||
server.getPagingManager().getPageStore(ADDRESS).forceAnotherPage();
|
||||
server.getPagingManager().getPageStore(ADDRESS).disableCleanup();
|
||||
|
@ -365,7 +365,7 @@ public class PagingTest extends ParameterDBTestBase {
|
|||
|
||||
ClientSession session = sf.createSession(null, null, false, false, false, false, 0);
|
||||
|
||||
session.createQueue(new QueueConfiguration(ADDRESS.concat("-0")).setAddress(ADDRESS));
|
||||
session.createQueue(QueueConfiguration.of(ADDRESS.concat("-0")).setAddress(ADDRESS));
|
||||
|
||||
server.getPagingManager().getPageStore(ADDRESS).startPaging();
|
||||
server.getPagingManager().getPageStore(ADDRESS).disableCleanup();
|
||||
|
@ -433,7 +433,7 @@ public class PagingTest extends ParameterDBTestBase {
|
|||
|
||||
ClientSession session = sf.createSession(null, null, false, false, false, false, 0);
|
||||
|
||||
session.createQueue(new QueueConfiguration(ADDRESS.concat("-0")).setAddress(ADDRESS));
|
||||
session.createQueue(QueueConfiguration.of(ADDRESS.concat("-0")).setAddress(ADDRESS));
|
||||
|
||||
server.getPagingManager().getPageStore(ADDRESS).startPaging();
|
||||
server.getPagingManager().getPageStore(ADDRESS).disableCleanup();
|
||||
|
@ -492,7 +492,7 @@ public class PagingTest extends ParameterDBTestBase {
|
|||
|
||||
ClientSession session = sf.createSession(false, false, false);
|
||||
|
||||
session.createQueue(new QueueConfiguration(PagingTest.ADDRESS));
|
||||
session.createQueue(QueueConfiguration.of(PagingTest.ADDRESS));
|
||||
|
||||
ClientProducer producer = session.createProducer(PagingTest.ADDRESS);
|
||||
|
||||
|
@ -594,7 +594,7 @@ public class PagingTest extends ParameterDBTestBase {
|
|||
server.start();
|
||||
|
||||
server.addAddressInfo(new AddressInfo(getName()).addRoutingType(RoutingType.ANYCAST));
|
||||
server.createQueue(new QueueConfiguration(getName()).setRoutingType(RoutingType.ANYCAST));
|
||||
server.createQueue(QueueConfiguration.of(getName()).setRoutingType(RoutingType.ANYCAST));
|
||||
|
||||
Queue serverQueue = server.locateQueue(getName());
|
||||
|
||||
|
@ -662,7 +662,7 @@ public class PagingTest extends ParameterDBTestBase {
|
|||
|
||||
ClientSession session = sf.createSession(false, false, false);
|
||||
|
||||
session.createQueue(new QueueConfiguration(PagingTest.ADDRESS));
|
||||
session.createQueue(QueueConfiguration.of(PagingTest.ADDRESS));
|
||||
|
||||
ClientProducer producer = session.createProducer(PagingTest.ADDRESS);
|
||||
|
||||
|
@ -746,7 +746,7 @@ public class PagingTest extends ParameterDBTestBase {
|
|||
|
||||
ClientSession session = sf.createSession(false, false, false);
|
||||
|
||||
session.createQueue(new QueueConfiguration(PagingTest.ADDRESS));
|
||||
session.createQueue(QueueConfiguration.of(PagingTest.ADDRESS));
|
||||
|
||||
ClientProducer producer = session.createProducer(PagingTest.ADDRESS);
|
||||
|
||||
|
@ -815,8 +815,8 @@ public class PagingTest extends ParameterDBTestBase {
|
|||
server.start();
|
||||
|
||||
server.addAddressInfo(new AddressInfo(address).addRoutingType(RoutingType.MULTICAST));
|
||||
server.createQueue(new QueueConfiguration(address + "_1").setAddress(address).setRoutingType(RoutingType.MULTICAST).setDurable(true).setFilterString("page<>5"));
|
||||
server.createQueue(new QueueConfiguration(address + "_2").setAddress(address).setRoutingType(RoutingType.MULTICAST).setDurable(true).setFilterString("page=5"));
|
||||
server.createQueue(QueueConfiguration.of(address + "_1").setAddress(address).setRoutingType(RoutingType.MULTICAST).setDurable(true).setFilterString("page<>5"));
|
||||
server.createQueue(QueueConfiguration.of(address + "_2").setAddress(address).setRoutingType(RoutingType.MULTICAST).setDurable(true).setFilterString("page=5"));
|
||||
|
||||
final int numberOfMessages = 100;
|
||||
|
||||
|
@ -949,7 +949,7 @@ public class PagingTest extends ParameterDBTestBase {
|
|||
server.start();
|
||||
|
||||
server.addAddressInfo(new AddressInfo(address).addRoutingType(RoutingType.ANYCAST));
|
||||
server.createQueue(new QueueConfiguration(address).setAddress(address).setRoutingType(RoutingType.ANYCAST).setDurable(true));
|
||||
server.createQueue(QueueConfiguration.of(address).setAddress(address).setRoutingType(RoutingType.ANYCAST).setDurable(true));
|
||||
|
||||
final int numberOfMessages = 20;
|
||||
|
||||
|
@ -1032,8 +1032,8 @@ public class PagingTest extends ParameterDBTestBase {
|
|||
|
||||
ClientSession session = sf.createSession(false, false, false);
|
||||
|
||||
session.createQueue(new QueueConfiguration(PagingTest.ADDRESS + "Queue").setAddress(PagingTest.ADDRESS));
|
||||
session.createQueue(new QueueConfiguration(PagingTest.ADDRESS + "QueueOriginal").setAddress(PagingTest.ADDRESS + "Original"));
|
||||
session.createQueue(QueueConfiguration.of(PagingTest.ADDRESS + "Queue").setAddress(PagingTest.ADDRESS));
|
||||
session.createQueue(QueueConfiguration.of(PagingTest.ADDRESS + "QueueOriginal").setAddress(PagingTest.ADDRESS + "Original"));
|
||||
|
||||
ClientProducer producer = session.createProducer(PagingTest.ADDRESS);
|
||||
|
||||
|
@ -1132,7 +1132,7 @@ public class PagingTest extends ParameterDBTestBase {
|
|||
|
||||
ClientSession session = sf.createSession(false, false, false);
|
||||
|
||||
session.createQueue(new QueueConfiguration(fqqn).setRoutingType(RoutingType.ANYCAST));
|
||||
session.createQueue(QueueConfiguration.of(fqqn).setRoutingType(RoutingType.ANYCAST));
|
||||
|
||||
ClientProducer producer = session.createProducer(fqqn);
|
||||
|
||||
|
@ -1193,7 +1193,7 @@ public class PagingTest extends ParameterDBTestBase {
|
|||
|
||||
ClientSession session = sf.createSession(false, true, true);
|
||||
server.addAddressInfo(new AddressInfo(PagingTest.ADDRESS, RoutingType.ANYCAST));
|
||||
Queue queue = server.createQueue(new QueueConfiguration(ADDRESS).setRoutingType(RoutingType.ANYCAST));
|
||||
Queue queue = server.createQueue(QueueConfiguration.of(ADDRESS).setRoutingType(RoutingType.ANYCAST));
|
||||
|
||||
queue.getPageSubscription().getPagingStore().startPaging();
|
||||
|
||||
|
@ -1295,7 +1295,7 @@ public class PagingTest extends ParameterDBTestBase {
|
|||
|
||||
ClientSession session = sf.createSession(false, true, true);
|
||||
|
||||
session.createQueue(new QueueConfiguration(PagingTest.ADDRESS));
|
||||
session.createQueue(QueueConfiguration.of(PagingTest.ADDRESS));
|
||||
|
||||
Queue queue = server.locateQueue(PagingTest.ADDRESS);
|
||||
|
||||
|
@ -1474,7 +1474,7 @@ public class PagingTest extends ParameterDBTestBase {
|
|||
|
||||
ClientSession session = sf.createSession(false, true, true);
|
||||
|
||||
session.createQueue(new QueueConfiguration(PagingTest.ADDRESS));
|
||||
session.createQueue(QueueConfiguration.of(PagingTest.ADDRESS));
|
||||
|
||||
Queue queue = server.locateQueue(PagingTest.ADDRESS);
|
||||
|
||||
|
@ -1587,9 +1587,9 @@ public class PagingTest extends ParameterDBTestBase {
|
|||
|
||||
ClientSession session = sf.createSession(false, false, false);
|
||||
|
||||
session.createQueue(new QueueConfiguration(PagingTest.ADDRESS));
|
||||
session.createQueue(QueueConfiguration.of(PagingTest.ADDRESS));
|
||||
|
||||
session.createQueue(new QueueConfiguration("EXP"));
|
||||
session.createQueue(QueueConfiguration.of("EXP"));
|
||||
|
||||
Queue queue1 = server.locateQueue(ADDRESS);
|
||||
Queue qEXP = server.locateQueue(SimpleString.of("EXP"));
|
||||
|
@ -1711,9 +1711,9 @@ public class PagingTest extends ParameterDBTestBase {
|
|||
|
||||
ClientSession session = sf.createSession(false, false, false);
|
||||
|
||||
session.createQueue(new QueueConfiguration(PagingTest.ADDRESS));
|
||||
session.createQueue(QueueConfiguration.of(PagingTest.ADDRESS));
|
||||
|
||||
session.createQueue(new QueueConfiguration(QUEUE2).setAddress(PagingTest.ADDRESS));
|
||||
session.createQueue(QueueConfiguration.of(QUEUE2).setAddress(PagingTest.ADDRESS));
|
||||
|
||||
ClientProducer producer = session.createProducer(PagingTest.ADDRESS);
|
||||
|
||||
|
@ -1839,7 +1839,7 @@ public class PagingTest extends ParameterDBTestBase {
|
|||
|
||||
SimpleString queue = SimpleString.of("testPurge:" + RandomUtil.randomString());
|
||||
server.addAddressInfo(new AddressInfo(queue, RoutingType.ANYCAST));
|
||||
QueueImpl purgeQueue = (QueueImpl) server.createQueue(new QueueConfiguration(queue).setRoutingType(RoutingType.ANYCAST).setMaxConsumers(1).setPurgeOnNoConsumers(false).setAutoCreateAddress(false));
|
||||
QueueImpl purgeQueue = (QueueImpl) server.createQueue(QueueConfiguration.of(queue).setRoutingType(RoutingType.ANYCAST).setMaxConsumers(1).setPurgeOnNoConsumers(false).setAutoCreateAddress(false));
|
||||
|
||||
ConnectionFactory cf = CFUtil.createConnectionFactory("CORE", "tcp://localhost:61616");
|
||||
Connection connection = cf.createConnection();
|
||||
|
@ -1889,7 +1889,7 @@ public class PagingTest extends ParameterDBTestBase {
|
|||
|
||||
ClientSession session = sf.createSession(false, false, false);
|
||||
|
||||
session.createQueue(new QueueConfiguration(PagingTest.ADDRESS));
|
||||
session.createQueue(QueueConfiguration.of(PagingTest.ADDRESS));
|
||||
|
||||
ClientProducer producer = session.createProducer(PagingTest.ADDRESS);
|
||||
|
||||
|
@ -2063,7 +2063,7 @@ public class PagingTest extends ParameterDBTestBase {
|
|||
|
||||
ClientSession session = sf.createSession(false, false, false);
|
||||
|
||||
session.createQueue(new QueueConfiguration(PagingTest.ADDRESS));
|
||||
session.createQueue(QueueConfiguration.of(PagingTest.ADDRESS));
|
||||
|
||||
ClientProducer producer = session.createProducer(PagingTest.ADDRESS);
|
||||
|
||||
|
@ -2129,7 +2129,7 @@ public class PagingTest extends ParameterDBTestBase {
|
|||
|
||||
ClientSession session = sf.createSession(false, false, false);
|
||||
|
||||
session.createQueue(new QueueConfiguration(PagingTest.ADDRESS));
|
||||
session.createQueue(QueueConfiguration.of(PagingTest.ADDRESS));
|
||||
|
||||
ClientProducer producer = session.createProducer(PagingTest.ADDRESS);
|
||||
|
||||
|
@ -2239,9 +2239,9 @@ public class PagingTest extends ParameterDBTestBase {
|
|||
|
||||
ClientSession session = sf.createSession(false, false, false);
|
||||
|
||||
session.createQueue(new QueueConfiguration("q1").setAddress(ADDRESS.toString()));
|
||||
session.createQueue(QueueConfiguration.of("q1").setAddress(ADDRESS.toString()));
|
||||
|
||||
session.createQueue(new QueueConfiguration("q2").setAddress(ADDRESS.toString()));
|
||||
session.createQueue(QueueConfiguration.of("q2").setAddress(ADDRESS.toString()));
|
||||
|
||||
ClientProducer producer = session.createProducer(PagingTest.ADDRESS);
|
||||
|
||||
|
@ -2351,9 +2351,9 @@ public class PagingTest extends ParameterDBTestBase {
|
|||
|
||||
ClientSession session = sf.createSession(false, false, false);
|
||||
|
||||
session.createQueue(new QueueConfiguration("q1").setAddress(ADDRESS.toString()));
|
||||
session.createQueue(QueueConfiguration.of("q1").setAddress(ADDRESS.toString()));
|
||||
|
||||
session.createQueue(new QueueConfiguration("q2").setAddress(ADDRESS.toString()));
|
||||
session.createQueue(QueueConfiguration.of("q2").setAddress(ADDRESS.toString()));
|
||||
|
||||
server.getPagingManager().getPageStore(ADDRESS).startPaging();
|
||||
|
||||
|
@ -2472,8 +2472,8 @@ public class PagingTest extends ParameterDBTestBase {
|
|||
|
||||
ClientSession session = sf.createSession(false, false, false);
|
||||
|
||||
session.createQueue(new QueueConfiguration(PagingTest.ADDRESS));
|
||||
session.createQueue(new QueueConfiguration(PagingTest.ADDRESS.concat("-invalid")).setAddress(PagingTest.ADDRESS).setFilterString(SimpleString.of(Filter.GENERIC_IGNORED_FILTER)));
|
||||
session.createQueue(QueueConfiguration.of(PagingTest.ADDRESS));
|
||||
session.createQueue(QueueConfiguration.of(PagingTest.ADDRESS.concat("-invalid")).setAddress(PagingTest.ADDRESS).setFilterString(SimpleString.of(Filter.GENERIC_IGNORED_FILTER)));
|
||||
|
||||
ClientProducer producer = session.createProducer(PagingTest.ADDRESS);
|
||||
|
||||
|
@ -2593,11 +2593,11 @@ public class PagingTest extends ParameterDBTestBase {
|
|||
ClientSession session = sf.createSession(false, false, false);
|
||||
|
||||
if (divert) {
|
||||
session.createQueue(new QueueConfiguration(PagingTest.ADDRESS + "-1"));
|
||||
session.createQueue(new QueueConfiguration(PagingTest.ADDRESS + "-2"));
|
||||
session.createQueue(QueueConfiguration.of(PagingTest.ADDRESS + "-1"));
|
||||
session.createQueue(QueueConfiguration.of(PagingTest.ADDRESS + "-2"));
|
||||
} else {
|
||||
session.createQueue(new QueueConfiguration(PagingTest.ADDRESS + "-1").setAddress(PagingTest.ADDRESS));
|
||||
session.createQueue(new QueueConfiguration(PagingTest.ADDRESS + "-2").setAddress(PagingTest.ADDRESS));
|
||||
session.createQueue(QueueConfiguration.of(PagingTest.ADDRESS + "-1").setAddress(PagingTest.ADDRESS));
|
||||
session.createQueue(QueueConfiguration.of(PagingTest.ADDRESS + "-2").setAddress(PagingTest.ADDRESS));
|
||||
}
|
||||
|
||||
ClientProducer producer = session.createProducer(PagingTest.ADDRESS);
|
||||
|
@ -2770,8 +2770,8 @@ public class PagingTest extends ParameterDBTestBase {
|
|||
|
||||
ClientSession session = sf.createSession(false, false, false);
|
||||
|
||||
session.createQueue(new QueueConfiguration(PagingTest.ADDRESS + "-1").setAddress(PagingTest.ADDRESS));
|
||||
session.createQueue(new QueueConfiguration(PagingTest.ADDRESS + "-2").setAddress(PagingTest.ADDRESS).setDurable(false));
|
||||
session.createQueue(QueueConfiguration.of(PagingTest.ADDRESS + "-1").setAddress(PagingTest.ADDRESS));
|
||||
session.createQueue(QueueConfiguration.of(PagingTest.ADDRESS + "-2").setAddress(PagingTest.ADDRESS).setDurable(false));
|
||||
|
||||
ClientProducer producer = session.createProducer(PagingTest.ADDRESS);
|
||||
|
||||
|
@ -2871,7 +2871,7 @@ public class PagingTest extends ParameterDBTestBase {
|
|||
|
||||
ClientSession session = sf.createSession(null, null, false, true, true, false, 0);
|
||||
|
||||
session.createQueue(new QueueConfiguration(PagingTest.ADDRESS));
|
||||
session.createQueue(QueueConfiguration.of(PagingTest.ADDRESS));
|
||||
|
||||
Queue queue = server.locateQueue(ADDRESS);
|
||||
queue.getPageSubscription().getPagingStore().startPaging();
|
||||
|
@ -2975,7 +2975,7 @@ public class PagingTest extends ParameterDBTestBase {
|
|||
|
||||
ClientSession session = sf.createSession(null, null, false, true, true, false, 0);
|
||||
|
||||
session.createQueue(new QueueConfiguration(PagingTest.ADDRESS));
|
||||
session.createQueue(QueueConfiguration.of(PagingTest.ADDRESS));
|
||||
|
||||
ClientProducer producer = session.createProducer(PagingTest.ADDRESS);
|
||||
|
||||
|
@ -3090,7 +3090,7 @@ public class PagingTest extends ParameterDBTestBase {
|
|||
ClientProducer producerTransacted = sessionTransacted.createProducer(PagingTest.ADDRESS);
|
||||
|
||||
ClientSession session = sf.createSession(null, null, false, false, true, false, 0);
|
||||
session.createQueue(new QueueConfiguration(PagingTest.ADDRESS));
|
||||
session.createQueue(QueueConfiguration.of(PagingTest.ADDRESS));
|
||||
|
||||
ClientMessage firstMessage = sessionTransacted.createMessage(IS_DURABLE_MESSAGE);
|
||||
firstMessage.getBodyBuffer().writeBytes(body);
|
||||
|
@ -3205,7 +3205,7 @@ public class PagingTest extends ParameterDBTestBase {
|
|||
ClientProducer producerTransacted = sessionTransacted.createProducer(PagingTest.ADDRESS);
|
||||
|
||||
ClientSession sessionNonTX = sf.createSession(true, true, 0);
|
||||
sessionNonTX.createQueue(new QueueConfiguration(PagingTest.ADDRESS));
|
||||
sessionNonTX.createQueue(QueueConfiguration.of(PagingTest.ADDRESS));
|
||||
|
||||
ClientProducer producerNonTransacted = sessionNonTX.createProducer(PagingTest.ADDRESS);
|
||||
|
||||
|
@ -3298,7 +3298,7 @@ public class PagingTest extends ParameterDBTestBase {
|
|||
|
||||
ClientSession session = sf.createSession(false, false, 0);
|
||||
session.start();
|
||||
session.createQueue(new QueueConfiguration(PagingTest.ADDRESS));
|
||||
session.createQueue(QueueConfiguration.of(PagingTest.ADDRESS));
|
||||
|
||||
executorService.execute(() -> {
|
||||
ClientSession sessionProducer = null;
|
||||
|
@ -3426,7 +3426,7 @@ public class PagingTest extends ParameterDBTestBase {
|
|||
|
||||
ClientSession session = sf.createSession(true, true, 0);
|
||||
session.start();
|
||||
session.createQueue(new QueueConfiguration(PagingTest.ADDRESS));
|
||||
session.createQueue(QueueConfiguration.of(PagingTest.ADDRESS));
|
||||
|
||||
producerThread.start();
|
||||
|
||||
|
@ -3479,7 +3479,7 @@ public class PagingTest extends ParameterDBTestBase {
|
|||
sf = createSessionFactory(locator);
|
||||
ClientSession session = sf.createSession(null, null, false, true, true, false, 0);
|
||||
|
||||
session.createQueue(new QueueConfiguration(PagingTest.ADDRESS));
|
||||
session.createQueue(QueueConfiguration.of(PagingTest.ADDRESS));
|
||||
|
||||
ClientProducer producer = session.createProducer(PagingTest.ADDRESS);
|
||||
|
||||
|
@ -3575,7 +3575,7 @@ public class PagingTest extends ParameterDBTestBase {
|
|||
sf = createSessionFactory(locator);
|
||||
ClientSession session = sf.createSession(null, null, false, false, true, false, 0);
|
||||
|
||||
session.createQueue(new QueueConfiguration(PagingTest.ADDRESS));
|
||||
session.createQueue(QueueConfiguration.of(PagingTest.ADDRESS));
|
||||
|
||||
ClientProducer producer = session.createProducer(PagingTest.ADDRESS);
|
||||
|
||||
|
@ -3620,7 +3620,7 @@ public class PagingTest extends ParameterDBTestBase {
|
|||
sf = createSessionFactory(locator);
|
||||
ClientSession session = sf.createSession(null, null, false, false, true, false, 0);
|
||||
|
||||
session.createQueue(new QueueConfiguration(PagingTest.ADDRESS));
|
||||
session.createQueue(QueueConfiguration.of(PagingTest.ADDRESS));
|
||||
|
||||
Queue queue = server.locateQueue(ADDRESS);
|
||||
|
||||
|
@ -3743,7 +3743,7 @@ public class PagingTest extends ParameterDBTestBase {
|
|||
|
||||
sf = createSessionFactory(locator);
|
||||
ClientSession session = sf.createSession(true, true, 0);
|
||||
session.createQueue(new QueueConfiguration(PagingTest.ADDRESS));
|
||||
session.createQueue(QueueConfiguration.of(PagingTest.ADDRESS));
|
||||
|
||||
final Queue queue1 = server.locateQueue(ADDRESS);
|
||||
|
||||
|
@ -3852,7 +3852,7 @@ public class PagingTest extends ParameterDBTestBase {
|
|||
sf = createSessionFactory(locator);
|
||||
ClientSession session = sf.createSession(null, null, false, false, false, false, 0);
|
||||
|
||||
session.createQueue(new QueueConfiguration(PagingTest.ADDRESS));
|
||||
session.createQueue(QueueConfiguration.of(PagingTest.ADDRESS));
|
||||
|
||||
ClientProducer producer = session.createProducer(PagingTest.ADDRESS);
|
||||
|
||||
|
@ -3969,7 +3969,7 @@ public class PagingTest extends ParameterDBTestBase {
|
|||
sf = createSessionFactory(locator);
|
||||
ClientSession session = sf.createSession(null, null, false, false, true, false, 0);
|
||||
|
||||
session.createQueue(new QueueConfiguration(PagingTest.ADDRESS));
|
||||
session.createQueue(QueueConfiguration.of(PagingTest.ADDRESS));
|
||||
|
||||
ClientProducer producer = session.createProducer(PagingTest.ADDRESS);
|
||||
|
||||
|
@ -4080,7 +4080,7 @@ public class PagingTest extends ParameterDBTestBase {
|
|||
sf = createSessionFactory(locator);
|
||||
ClientSession sessionProducer = sf.createSession();
|
||||
|
||||
sessionProducer.createQueue(new QueueConfiguration(PagingTest.ADDRESS));
|
||||
sessionProducer.createQueue(QueueConfiguration.of(PagingTest.ADDRESS));
|
||||
|
||||
ClientProducer producer = sessionProducer.createProducer(PagingTest.ADDRESS);
|
||||
|
||||
|
@ -4152,7 +4152,7 @@ public class PagingTest extends ParameterDBTestBase {
|
|||
ClientSession session = sf.createSession(null, null, false, !transacted, true, false, 0);
|
||||
|
||||
for (int i = 0; i < NUMBER_OF_BINDINGS; i++) {
|
||||
session.createQueue(new QueueConfiguration(SimpleString.of("someQueue" + i)).setAddress(PagingTest.ADDRESS).setDurable(true));
|
||||
session.createQueue(QueueConfiguration.of(SimpleString.of("someQueue" + i)).setAddress(PagingTest.ADDRESS).setDurable(true));
|
||||
}
|
||||
|
||||
ClientProducer producer = session.createProducer(PagingTest.ADDRESS);
|
||||
|
@ -4223,7 +4223,7 @@ public class PagingTest extends ParameterDBTestBase {
|
|||
|
||||
try {
|
||||
server.addAddressInfo(new AddressInfo(PagingTest.ADDRESS, RoutingType.ANYCAST));
|
||||
server.createQueue(new QueueConfiguration(PagingTest.ADDRESS).setRoutingType(RoutingType.ANYCAST));
|
||||
server.createQueue(QueueConfiguration.of(PagingTest.ADDRESS).setRoutingType(RoutingType.ANYCAST));
|
||||
|
||||
final CountDownLatch pageUp = new CountDownLatch(0);
|
||||
final CountDownLatch pageDone = new CountDownLatch(1);
|
||||
|
@ -4262,7 +4262,7 @@ public class PagingTest extends ParameterDBTestBase {
|
|||
server = createServer(true, config, PagingTest.PAGE_SIZE, PagingTest.PAGE_MAX);
|
||||
|
||||
server.start();
|
||||
server.createQueue(new QueueConfiguration(PagingTest.ADDRESS).setRoutingType(RoutingType.ANYCAST));
|
||||
server.createQueue(QueueConfiguration.of(PagingTest.ADDRESS).setRoutingType(RoutingType.ANYCAST));
|
||||
|
||||
final CountDownLatch pageUp = new CountDownLatch(0);
|
||||
final CountDownLatch pageDone = new CountDownLatch(1);
|
||||
|
@ -4306,9 +4306,9 @@ public class PagingTest extends ParameterDBTestBase {
|
|||
|
||||
ClientSession session = sf.createSession(false, true, false);
|
||||
|
||||
session.createQueue(new QueueConfiguration(PAGED_ADDRESS));
|
||||
session.createQueue(QueueConfiguration.of(PAGED_ADDRESS));
|
||||
|
||||
session.createQueue(new QueueConfiguration(NON_PAGED_ADDRESS));
|
||||
session.createQueue(QueueConfiguration.of(NON_PAGED_ADDRESS));
|
||||
|
||||
ClientProducer producerPaged = session.createProducer(PAGED_ADDRESS);
|
||||
ClientProducer producerNonPaged = session.createProducer(NON_PAGED_ADDRESS);
|
||||
|
@ -4389,7 +4389,7 @@ public class PagingTest extends ParameterDBTestBase {
|
|||
|
||||
ClientSession session = sf.createSession(false, false, false);
|
||||
|
||||
session.createQueue(new QueueConfiguration(PAGED_ADDRESS));
|
||||
session.createQueue(QueueConfiguration.of(PAGED_ADDRESS));
|
||||
|
||||
Wait.assertTrue(() -> null != server.locateQueue(PAGED_ADDRESS));
|
||||
|
||||
|
@ -4450,7 +4450,7 @@ public class PagingTest extends ParameterDBTestBase {
|
|||
int NQUEUES = 2;
|
||||
|
||||
for (int i = 0; i < NQUEUES; i++) {
|
||||
session.createQueue(new QueueConfiguration(PagingTest.ADDRESS.concat("=" + i)).setAddress(PagingTest.ADDRESS).setFilterString(SimpleString.of("propTest=" + i)).setDurable(true));
|
||||
session.createQueue(QueueConfiguration.of(PagingTest.ADDRESS.concat("=" + i)).setAddress(PagingTest.ADDRESS).setFilterString(SimpleString.of("propTest=" + i)).setDurable(true));
|
||||
}
|
||||
|
||||
ClientProducer producer = session.createProducer(PagingTest.ADDRESS);
|
||||
|
@ -4530,8 +4530,8 @@ public class PagingTest extends ParameterDBTestBase {
|
|||
|
||||
ClientSession session = sf.createSession(false, false, false);
|
||||
|
||||
session.createQueue(new QueueConfiguration(PagingTest.ADDRESS.concat("=1")).setAddress(PagingTest.ADDRESS));
|
||||
session.createQueue(new QueueConfiguration(PagingTest.ADDRESS.concat("=2")).setAddress(PagingTest.ADDRESS));
|
||||
session.createQueue(QueueConfiguration.of(PagingTest.ADDRESS.concat("=1")).setAddress(PagingTest.ADDRESS));
|
||||
session.createQueue(QueueConfiguration.of(PagingTest.ADDRESS.concat("=2")).setAddress(PagingTest.ADDRESS));
|
||||
|
||||
ClientProducer producer = session.createProducer(PagingTest.ADDRESS);
|
||||
|
||||
|
@ -4609,11 +4609,11 @@ public class PagingTest extends ParameterDBTestBase {
|
|||
|
||||
ClientSession session = sf.createSession(false, false, false);
|
||||
|
||||
session.createQueue(new QueueConfiguration(PagingTest.ADDRESS.concat("=1")).setAddress(PagingTest.ADDRESS));
|
||||
session.createQueue(new QueueConfiguration(PagingTest.ADDRESS.concat("=2")).setAddress(PagingTest.ADDRESS));
|
||||
session.createQueue(QueueConfiguration.of(PagingTest.ADDRESS.concat("=1")).setAddress(PagingTest.ADDRESS));
|
||||
session.createQueue(QueueConfiguration.of(PagingTest.ADDRESS.concat("=2")).setAddress(PagingTest.ADDRESS));
|
||||
|
||||
// A queue with an impossible filter
|
||||
session.createQueue(new QueueConfiguration(PagingTest.ADDRESS.concat("-3")).setAddress(PagingTest.ADDRESS).setFilterString(SimpleString.of("nothing='something'")));
|
||||
session.createQueue(QueueConfiguration.of(PagingTest.ADDRESS.concat("-3")).setAddress(PagingTest.ADDRESS).setFilterString(SimpleString.of("nothing='something'")));
|
||||
|
||||
PagingStore store = server.getPagingManager().getPageStore(ADDRESS);
|
||||
|
||||
|
@ -4686,8 +4686,8 @@ public class PagingTest extends ParameterDBTestBase {
|
|||
|
||||
ClientSession session = sf.createSession(false, false, false);
|
||||
|
||||
session.createQueue(new QueueConfiguration(PagingTest.ADDRESS.concat("=1")).setAddress(PagingTest.ADDRESS));
|
||||
session.createQueue(new QueueConfiguration(PagingTest.ADDRESS.concat("=2")).setAddress(PagingTest.ADDRESS));
|
||||
session.createQueue(QueueConfiguration.of(PagingTest.ADDRESS.concat("=1")).setAddress(PagingTest.ADDRESS));
|
||||
session.createQueue(QueueConfiguration.of(PagingTest.ADDRESS.concat("=2")).setAddress(PagingTest.ADDRESS));
|
||||
|
||||
ClientProducer producer = session.createProducer(PagingTest.ADDRESS);
|
||||
|
||||
|
@ -4790,8 +4790,8 @@ public class PagingTest extends ParameterDBTestBase {
|
|||
|
||||
session = sf.createSession(false, false, false);
|
||||
|
||||
session.createQueue(new QueueConfiguration(ADDRESS));
|
||||
session.createQueue(new QueueConfiguration("DLA"));
|
||||
session.createQueue(QueueConfiguration.of(ADDRESS));
|
||||
session.createQueue(QueueConfiguration.of("DLA"));
|
||||
|
||||
Queue serverQueue = server.locateQueue(ADDRESS);
|
||||
|
||||
|
@ -4988,9 +4988,9 @@ public class PagingTest extends ParameterDBTestBase {
|
|||
|
||||
ClientSession session = sf.createSession(false, false, false);
|
||||
|
||||
session.createQueue(new QueueConfiguration(ADDRESS));
|
||||
session.createQueue(QueueConfiguration.of(ADDRESS));
|
||||
|
||||
session.createQueue(new QueueConfiguration("DLA"));
|
||||
session.createQueue(QueueConfiguration.of("DLA"));
|
||||
|
||||
PagingStore pgStoreAddress = server.getPagingManager().getPageStore(ADDRESS);
|
||||
pgStoreAddress.startPaging();
|
||||
|
@ -5113,7 +5113,7 @@ public class PagingTest extends ParameterDBTestBase {
|
|||
sf = createSessionFactory(locator);
|
||||
ClientSession session = sf.createSession(true, true, 0);
|
||||
|
||||
session.createQueue(new QueueConfiguration(PagingTest.ADDRESS));
|
||||
session.createQueue(QueueConfiguration.of(PagingTest.ADDRESS));
|
||||
|
||||
ClientProducer producer = session.createProducer(PagingTest.ADDRESS);
|
||||
|
||||
|
@ -5184,7 +5184,7 @@ public class PagingTest extends ParameterDBTestBase {
|
|||
sf = createSessionFactory(locator);
|
||||
ClientSession session = sf.createSession(true, true, 0);
|
||||
|
||||
session.createQueue(new QueueConfiguration(PagingTest.ADDRESS));
|
||||
session.createQueue(QueueConfiguration.of(PagingTest.ADDRESS));
|
||||
|
||||
ClientProducer producer = session.createProducer(PagingTest.ADDRESS);
|
||||
|
||||
|
@ -5255,7 +5255,7 @@ public class PagingTest extends ParameterDBTestBase {
|
|||
sf = createSessionFactory(locator);
|
||||
ClientSession session = addClientSession(sf.createSession(true, true, 0));
|
||||
|
||||
session.createQueue(new QueueConfiguration(PagingTest.ADDRESS));
|
||||
session.createQueue(QueueConfiguration.of(PagingTest.ADDRESS));
|
||||
|
||||
ClientProducer producer = session.createProducer(PagingTest.ADDRESS);
|
||||
|
||||
|
@ -5354,9 +5354,9 @@ public class PagingTest extends ParameterDBTestBase {
|
|||
ClientSessionFactory sf = createSessionFactory(locator);
|
||||
ClientSession session = sf.createSession(false, true, 0);
|
||||
|
||||
session.createQueue(new QueueConfiguration("Q1").setAddress("Q").setFilterString("dest=1"));
|
||||
session.createQueue(new QueueConfiguration("Q2").setAddress("Q").setFilterString("dest=2"));
|
||||
session.createQueue(new QueueConfiguration("Q3").setAddress("Q").setFilterString("dest=3"));
|
||||
session.createQueue(QueueConfiguration.of("Q1").setAddress("Q").setFilterString("dest=1"));
|
||||
session.createQueue(QueueConfiguration.of("Q2").setAddress("Q").setFilterString("dest=2"));
|
||||
session.createQueue(QueueConfiguration.of("Q3").setAddress("Q").setFilterString("dest=3"));
|
||||
|
||||
Queue queue = server.locateQueue(SimpleString.of("Q1"));
|
||||
queue.getPageSubscription().getPagingStore().startPaging();
|
||||
|
@ -5415,15 +5415,15 @@ public class PagingTest extends ParameterDBTestBase {
|
|||
ClientSessionFactory sf = locator.createSessionFactory();
|
||||
ClientSession session = sf.createSession(true, false);
|
||||
|
||||
session.createQueue(new QueueConfiguration("Q1").setAddress(PagingTest.ADDRESS).setFilterString("destQ=1 or both=true"));
|
||||
session.createQueue(new QueueConfiguration("Q2").setAddress(PagingTest.ADDRESS).setFilterString("destQ=2 or both=true"));
|
||||
session.createQueue(QueueConfiguration.of("Q1").setAddress(PagingTest.ADDRESS).setFilterString("destQ=1 or both=true"));
|
||||
session.createQueue(QueueConfiguration.of("Q2").setAddress(PagingTest.ADDRESS).setFilterString("destQ=2 or both=true"));
|
||||
|
||||
if (deadConsumer) {
|
||||
// This queue won't receive any messages
|
||||
session.createQueue(new QueueConfiguration("Q3").setAddress(ADDRESS.toString()).setFilterString("destQ=3"));
|
||||
session.createQueue(QueueConfiguration.of("Q3").setAddress(ADDRESS.toString()).setFilterString("destQ=3"));
|
||||
}
|
||||
|
||||
session.createQueue(new QueueConfiguration("Q_initial").setAddress(ADDRESS.toString()).setFilterString("initialBurst=true"));
|
||||
session.createQueue(QueueConfiguration.of("Q_initial").setAddress(ADDRESS.toString()).setFilterString("initialBurst=true"));
|
||||
|
||||
ClientSession sessionConsumerQ3 = null;
|
||||
|
||||
|
@ -5585,8 +5585,8 @@ public class PagingTest extends ParameterDBTestBase {
|
|||
ClientSessionFactory sf = locator.createSessionFactory();
|
||||
ClientSession session = sf.createSession(true, true, 0);
|
||||
|
||||
session.createQueue(new QueueConfiguration("Q1").setAddress(ADDRESS.toString()).setFilterString("dest=1"));
|
||||
session.createQueue(new QueueConfiguration("Q2").setAddress(ADDRESS.toString()).setFilterString("dest=2"));
|
||||
session.createQueue(QueueConfiguration.of("Q1").setAddress(ADDRESS.toString()).setFilterString("dest=1"));
|
||||
session.createQueue(QueueConfiguration.of("Q2").setAddress(ADDRESS.toString()).setFilterString("dest=2"));
|
||||
|
||||
PagingStore store = server.getPagingManager().getPageStore(ADDRESS);
|
||||
|
||||
|
@ -5677,7 +5677,7 @@ public class PagingTest extends ParameterDBTestBase {
|
|||
ClientSessionFactory sf = locator.createSessionFactory();
|
||||
ClientSession session = sf.createSession(true, true, 0);
|
||||
|
||||
session.createQueue(new QueueConfiguration("Q1").setAddress(ADDRESS.toString()));
|
||||
session.createQueue(QueueConfiguration.of("Q1").setAddress(ADDRESS.toString()));
|
||||
|
||||
PagingStore store = server.getPagingManager().getPageStore(ADDRESS);
|
||||
|
||||
|
@ -5758,7 +5758,7 @@ public class PagingTest extends ParameterDBTestBase {
|
|||
ClientSessionFactory sf = locator.createSessionFactory();
|
||||
ClientSession session = sf.createSession(true, true, 0);
|
||||
|
||||
session.createQueue(new QueueConfiguration("Q1").setAddress(ADDRESS.toString()));
|
||||
session.createQueue(QueueConfiguration.of("Q1").setAddress(ADDRESS.toString()));
|
||||
|
||||
PagingStore store = server.getPagingManager().getPageStore(ADDRESS);
|
||||
|
||||
|
@ -5840,8 +5840,8 @@ public class PagingTest extends ParameterDBTestBase {
|
|||
ClientSessionFactory sf = locator.createSessionFactory();
|
||||
ClientSession session = sf.createSession(true, true, 0);
|
||||
|
||||
session.createQueue(new QueueConfiguration("Q1").setAddress(ADDRESS.toString()).setFilterString("dest=1"));
|
||||
session.createQueue(new QueueConfiguration("Q2").setAddress(ADDRESS.toString()).setFilterString("dest=2"));
|
||||
session.createQueue(QueueConfiguration.of("Q1").setAddress(ADDRESS.toString()).setFilterString("dest=1"));
|
||||
session.createQueue(QueueConfiguration.of("Q2").setAddress(ADDRESS.toString()).setFilterString("dest=2"));
|
||||
|
||||
PagingStore store = server.getPagingManager().getPageStore(ADDRESS);
|
||||
|
||||
|
@ -5910,7 +5910,7 @@ public class PagingTest extends ParameterDBTestBase {
|
|||
ClientSessionFactory sf = locator.createSessionFactory();
|
||||
ClientSession session = sf.createSession();
|
||||
|
||||
session.createQueue(new QueueConfiguration(ADDRESS));
|
||||
session.createQueue(QueueConfiguration.of(ADDRESS));
|
||||
ClientProducer prod = session.createProducer(ADDRESS);
|
||||
|
||||
for (int i = 0; i < 100; i++) {
|
||||
|
@ -5950,8 +5950,8 @@ public class PagingTest extends ParameterDBTestBase {
|
|||
ClientSessionFactory sf = locator.createSessionFactory();
|
||||
ClientSession session = sf.createSession(false, false, 0);
|
||||
|
||||
session.createQueue(new QueueConfiguration("Q1"));
|
||||
session.createQueue(new QueueConfiguration("Q2"));
|
||||
session.createQueue(QueueConfiguration.of("Q1"));
|
||||
session.createQueue(QueueConfiguration.of("Q2"));
|
||||
|
||||
PagingStore store = server.getPagingManager().getPageStore(SimpleString.of("Q1"));
|
||||
|
||||
|
@ -6106,7 +6106,7 @@ public class PagingTest extends ParameterDBTestBase {
|
|||
|
||||
ClientSession session = sf.createSession(false, true, false);
|
||||
|
||||
session.createQueue(new QueueConfiguration(PagingTest.ADDRESS));
|
||||
session.createQueue(QueueConfiguration.of(PagingTest.ADDRESS));
|
||||
|
||||
ClientProducer producer = session.createProducer(PagingTest.ADDRESS);
|
||||
|
||||
|
@ -6186,7 +6186,7 @@ public class PagingTest extends ParameterDBTestBase {
|
|||
|
||||
ClientSession session = sf.createSession(false, false, false);
|
||||
|
||||
session.createQueue(new QueueConfiguration(PagingTest.ADDRESS));
|
||||
session.createQueue(QueueConfiguration.of(PagingTest.ADDRESS));
|
||||
|
||||
ClientProducer producer = session.createProducer(PagingTest.ADDRESS);
|
||||
|
||||
|
@ -6261,8 +6261,8 @@ public class PagingTest extends ParameterDBTestBase {
|
|||
|
||||
ClientSessionFactory sf = locator.createSessionFactory();
|
||||
ClientSession session = sf.createSession(false, false, false);
|
||||
session.createQueue(new QueueConfiguration(PagingTest.ADDRESS.concat("=1")).setAddress(PagingTest.ADDRESS).setFilterString(SimpleString.of("destQ=1 or both=true")));
|
||||
session.createQueue(new QueueConfiguration(PagingTest.ADDRESS.concat("=2")).setAddress(PagingTest.ADDRESS).setFilterString(SimpleString.of("destQ=2 or both=true")));
|
||||
session.createQueue(QueueConfiguration.of(PagingTest.ADDRESS.concat("=1")).setAddress(PagingTest.ADDRESS).setFilterString("destQ=1 or both=true"));
|
||||
session.createQueue(QueueConfiguration.of(PagingTest.ADDRESS.concat("=2")).setAddress(PagingTest.ADDRESS).setFilterString("destQ=2 or both=true"));
|
||||
PagingStore store = server.getPagingManager().getPageStore(ADDRESS);
|
||||
Queue queue = server.locateQueue(PagingTest.ADDRESS.concat("=1"));
|
||||
queue.getPageSubscription().getPagingStore().startPaging();
|
||||
|
@ -6334,8 +6334,8 @@ public class PagingTest extends ParameterDBTestBase {
|
|||
|
||||
ClientSession session = sf.createSession(false, false, false);
|
||||
|
||||
session.createQueue(new QueueConfiguration(PagingTest.ADDRESS.concat("=1")).setAddress(PagingTest.ADDRESS).setFilterString(SimpleString.of("destQ=1")));
|
||||
session.createQueue(new QueueConfiguration(PagingTest.ADDRESS.concat("=2")).setAddress(PagingTest.ADDRESS).setFilterString(SimpleString.of("destQ=2")));
|
||||
session.createQueue(QueueConfiguration.of(PagingTest.ADDRESS.concat("=1")).setAddress(PagingTest.ADDRESS).setFilterString("destQ=1"));
|
||||
session.createQueue(QueueConfiguration.of(PagingTest.ADDRESS.concat("=2")).setAddress(PagingTest.ADDRESS).setFilterString("destQ=2"));
|
||||
|
||||
ClientProducer producer = session.createProducer(PagingTest.ADDRESS);
|
||||
ClientConsumer consumer1 = session.createConsumer(PagingTest.ADDRESS.concat("=1"));
|
||||
|
@ -6404,7 +6404,7 @@ public class PagingTest extends ParameterDBTestBase {
|
|||
ClientSessionFactory sf = locator.createSessionFactory();
|
||||
ClientSession session = sf.createSession(true, true, 0);
|
||||
|
||||
session.createQueue(new QueueConfiguration(ADDRESS));
|
||||
session.createQueue(QueueConfiguration.of(ADDRESS));
|
||||
|
||||
PagingStore store = server.getPagingManager().getPageStore(ADDRESS);
|
||||
store.startPaging();
|
||||
|
@ -6477,7 +6477,7 @@ public class PagingTest extends ParameterDBTestBase {
|
|||
sf = createSessionFactory(locator);
|
||||
ClientSession session = sf.createSession(null, null, false, false, true, false, 0);
|
||||
|
||||
session.createQueue(new QueueConfiguration(PagingTest.ADDRESS));
|
||||
session.createQueue(QueueConfiguration.of(PagingTest.ADDRESS));
|
||||
|
||||
Queue queue = server.locateQueue(PagingTest.ADDRESS);
|
||||
|
||||
|
@ -6541,7 +6541,7 @@ public class PagingTest extends ParameterDBTestBase {
|
|||
|
||||
try {
|
||||
server.addAddressInfo(new AddressInfo(queueName).addRoutingType(RoutingType.ANYCAST));
|
||||
server.createQueue(new QueueConfiguration(queueName).setRoutingType(RoutingType.ANYCAST));
|
||||
server.createQueue(QueueConfiguration.of(queueName).setRoutingType(RoutingType.ANYCAST));
|
||||
} catch (Exception ignored) {
|
||||
}
|
||||
|
||||
|
|
|
@ -69,7 +69,7 @@ public class PrintDataTest extends ParameterDBTestBase {
|
|||
|
||||
String queueName = RandomUtil.randomString();
|
||||
server.addAddressInfo(new AddressInfo(queueName).addRoutingType(RoutingType.ANYCAST));
|
||||
Queue queue = server.createQueue(new QueueConfiguration().setAddress(queueName).setName(queueName).setDurable(true).setRoutingType(RoutingType.ANYCAST));
|
||||
Queue queue = server.createQueue(QueueConfiguration.of(queueName).setAddress(queueName).setDurable(true).setRoutingType(RoutingType.ANYCAST));
|
||||
queue.getPagingStore().startPaging();
|
||||
|
||||
int numberOfMessages = 10;
|
||||
|
|
|
@ -79,7 +79,7 @@ public class ConnectionDroppedTest extends ActiveMQTestBase {
|
|||
int NUMBER_OF_CONNECTIONS = 100;
|
||||
ActiveMQServer server = createServer(true, createDefaultConfig(true));
|
||||
server.start();
|
||||
Queue serverQueue = server.createQueue(new QueueConfiguration("test-queue").setRoutingType(RoutingType.ANYCAST).setAddress("test-queue").setAutoCreated(false));
|
||||
Queue serverQueue = server.createQueue(QueueConfiguration.of("test-queue").setRoutingType(RoutingType.ANYCAST).setAddress("test-queue").setAutoCreated(false));
|
||||
|
||||
ExecutorService executorService = Executors.newFixedThreadPool(NUMBER_OF_CONNECTIONS);
|
||||
runAfter(executorService::shutdownNow);
|
||||
|
@ -124,7 +124,7 @@ public class ConnectionDroppedTest extends ActiveMQTestBase {
|
|||
int REPEATS = 10;
|
||||
ActiveMQServer server = createServer(true, createDefaultConfig(true));
|
||||
server.start();
|
||||
Queue serverQueue = server.createQueue(new QueueConfiguration("test-queue").setRoutingType(RoutingType.ANYCAST).setAddress("test-queue").setAutoCreated(false));
|
||||
Queue serverQueue = server.createQueue(QueueConfiguration.of("test-queue").setRoutingType(RoutingType.ANYCAST).setAddress("test-queue").setAutoCreated(false));
|
||||
|
||||
ExecutorService executorService = Executors.newFixedThreadPool(NUMBER_OF_CONNECTIONS);
|
||||
runAfter(executorService::shutdownNow);
|
||||
|
@ -198,7 +198,7 @@ public class ConnectionDroppedTest extends ActiveMQTestBase {
|
|||
int REPEATS = 10;
|
||||
ActiveMQServer server = createServer(true, createDefaultConfig(true));
|
||||
server.start();
|
||||
Queue serverQueue = server.createQueue(new QueueConfiguration("test-queue").setRoutingType(RoutingType.ANYCAST).setAddress("test-queue").setAutoCreated(false));
|
||||
Queue serverQueue = server.createQueue(QueueConfiguration.of("test-queue").setRoutingType(RoutingType.ANYCAST).setAddress("test-queue").setAutoCreated(false));
|
||||
|
||||
ExecutorService executorService = Executors.newFixedThreadPool(NUMBER_OF_CONNECTIONS);
|
||||
runAfter(executorService::shutdownNow);
|
||||
|
@ -333,7 +333,7 @@ public class ConnectionDroppedTest extends ActiveMQTestBase {
|
|||
ExecutorService executorService = Executors.newFixedThreadPool(1);
|
||||
runAfter(executorService::shutdownNow);
|
||||
runAfter(() -> running.set(false));
|
||||
Queue serverQueue = server.createQueue(new QueueConfiguration(getName()).setRoutingType(RoutingType.ANYCAST).setAddress(getName()).setAutoCreated(false));
|
||||
Queue serverQueue = server.createQueue(QueueConfiguration.of(getName()).setRoutingType(RoutingType.ANYCAST).setAddress(getName()).setAutoCreated(false));
|
||||
|
||||
for (int i = 0; i < TEST_REPEATS; i++) {
|
||||
assertEquals(0, serverQueue.getConsumerCount());
|
||||
|
@ -404,7 +404,7 @@ public class ConnectionDroppedTest extends ActiveMQTestBase {
|
|||
ActiveMQServer server = createServer(true, createDefaultConfig(true));
|
||||
server.start();
|
||||
|
||||
Queue serverQueue = server.createQueue(new QueueConfiguration(getName()).setRoutingType(RoutingType.ANYCAST).setAddress(getName()).setAutoCreated(false));
|
||||
Queue serverQueue = server.createQueue(QueueConfiguration.of(getName()).setRoutingType(RoutingType.ANYCAST).setAddress(getName()).setAutoCreated(false));
|
||||
|
||||
AtomicBoolean running = new AtomicBoolean(true);
|
||||
ExecutorService executorService = Executors.newFixedThreadPool(1);
|
||||
|
@ -514,7 +514,7 @@ public class ConnectionDroppedTest extends ActiveMQTestBase {
|
|||
ActiveMQServer server = createServer(true, createDefaultConfig(true));
|
||||
server.start();
|
||||
|
||||
Queue serverQueue = server.createQueue(new QueueConfiguration("test-queue").setRoutingType(RoutingType.ANYCAST).setAddress("test-queue").setAutoCreated(false));
|
||||
Queue serverQueue = server.createQueue(QueueConfiguration.of("test-queue").setRoutingType(RoutingType.ANYCAST).setAddress("test-queue").setAutoCreated(false));
|
||||
|
||||
CountDownLatch beforeCreateCalled = new CountDownLatch(1);
|
||||
CountDownLatch goCreateConsumer = new CountDownLatch(1);
|
||||
|
|
|
@ -161,7 +161,7 @@ public class JmxSecurityTest {
|
|||
server.getConfiguration().putSecurityRoles("jmx.queue.Q1.*", roles);
|
||||
|
||||
CoreAddressConfiguration address = new CoreAddressConfiguration();
|
||||
address.setName("Q1").addQueueConfig(new QueueConfiguration("Q1").setRoutingType(RoutingType.ANYCAST));
|
||||
address.setName("Q1").addQueueConfig(QueueConfiguration.of("Q1").setRoutingType(RoutingType.ANYCAST));
|
||||
server.getConfiguration().getAddressConfigurations().add(address);
|
||||
|
||||
server.start();
|
||||
|
@ -288,8 +288,8 @@ public class JmxSecurityTest {
|
|||
server.start();
|
||||
|
||||
server.addAddressInfo(new AddressInfo(ADDRESS, RoutingType.ANYCAST));
|
||||
server.createQueue(new QueueConfiguration(QUEUE_A).setAddress(ADDRESS).setRoutingType(RoutingType.ANYCAST));
|
||||
server.createQueue(new QueueConfiguration(QUEUE_B).setAddress(ADDRESS).setRoutingType(RoutingType.ANYCAST));
|
||||
server.createQueue(QueueConfiguration.of(QUEUE_A).setAddress(ADDRESS).setRoutingType(RoutingType.ANYCAST));
|
||||
server.createQueue(QueueConfiguration.of(QUEUE_B).setAddress(ADDRESS).setRoutingType(RoutingType.ANYCAST));
|
||||
|
||||
QueueControl queueControlA = JMX.newMBeanProxy(
|
||||
ManagementFactory.getPlatformMBeanServer(),
|
||||
|
|
|
@ -178,15 +178,15 @@ public class LDAPSecurityTest extends AbstractLdapTestUnit {
|
|||
roles.add(new Role("programmers", false, false, false, false, false, false, false, false, false, false, false, false));
|
||||
server.getConfiguration().putSecurityRoles("#", roles);
|
||||
server.start();
|
||||
server.createQueue(new QueueConfiguration(DURABLE_QUEUE).setAddress(ADDRESS));
|
||||
server.createQueue(new QueueConfiguration(NON_DURABLE_QUEUE).setAddress(ADDRESS).setDurable(false));
|
||||
server.createQueue(QueueConfiguration.of(DURABLE_QUEUE).setAddress(ADDRESS));
|
||||
server.createQueue(QueueConfiguration.of(NON_DURABLE_QUEUE).setAddress(ADDRESS).setDurable(false));
|
||||
|
||||
ClientSessionFactory cf = locator.createSessionFactory();
|
||||
ClientSession session = cf.createSession("first", "secret", false, true, true, false, 0);
|
||||
|
||||
// CREATE_DURABLE_QUEUE
|
||||
try {
|
||||
session.createQueue(new QueueConfiguration(DURABLE_QUEUE).setAddress(ADDRESS));
|
||||
session.createQueue(QueueConfiguration.of(DURABLE_QUEUE).setAddress(ADDRESS));
|
||||
Assert.fail("should throw exception here");
|
||||
} catch (ActiveMQException e) {
|
||||
// ignore
|
||||
|
@ -202,7 +202,7 @@ public class LDAPSecurityTest extends AbstractLdapTestUnit {
|
|||
|
||||
// CREATE_NON_DURABLE_QUEUE
|
||||
try {
|
||||
session.createQueue(new QueueConfiguration(NON_DURABLE_QUEUE).setAddress(ADDRESS).setDurable(false));
|
||||
session.createQueue(QueueConfiguration.of(NON_DURABLE_QUEUE).setAddress(ADDRESS).setDurable(false));
|
||||
Assert.fail("should throw exception here");
|
||||
} catch (ActiveMQException e) {
|
||||
// ignore
|
||||
|
@ -270,7 +270,7 @@ public class LDAPSecurityTest extends AbstractLdapTestUnit {
|
|||
|
||||
// CREATE_DURABLE_QUEUE
|
||||
try {
|
||||
session.createQueue(new QueueConfiguration(DURABLE_QUEUE).setAddress(ADDRESS));
|
||||
session.createQueue(QueueConfiguration.of(DURABLE_QUEUE).setAddress(ADDRESS));
|
||||
} catch (ActiveMQException e) {
|
||||
e.printStackTrace();
|
||||
Assert.fail("should not throw exception here");
|
||||
|
@ -286,7 +286,7 @@ public class LDAPSecurityTest extends AbstractLdapTestUnit {
|
|||
|
||||
// CREATE_NON_DURABLE_QUEUE
|
||||
try {
|
||||
session.createQueue(new QueueConfiguration(NON_DURABLE_QUEUE).setAddress(ADDRESS).setDurable(false));
|
||||
session.createQueue(QueueConfiguration.of(NON_DURABLE_QUEUE).setAddress(ADDRESS).setDurable(false));
|
||||
} catch (ActiveMQException e) {
|
||||
Assert.fail("should not throw exception here");
|
||||
}
|
||||
|
@ -298,7 +298,7 @@ public class LDAPSecurityTest extends AbstractLdapTestUnit {
|
|||
Assert.fail("should not throw exception here");
|
||||
}
|
||||
|
||||
session.createQueue(new QueueConfiguration(DURABLE_QUEUE).setAddress(ADDRESS));
|
||||
session.createQueue(QueueConfiguration.of(DURABLE_QUEUE).setAddress(ADDRESS));
|
||||
|
||||
// PRODUCE
|
||||
try {
|
||||
|
|
|
@ -171,7 +171,7 @@ public class LegacyLDAPSecuritySettingPluginListenerTest extends AbstractLdapTes
|
|||
String name = "queue1";
|
||||
ClientSession session = cf.createSession("first", "secret", false, true, true, false, 0);
|
||||
ClientSession session2 = cf.createSession("second", "secret", false, true, true, false, 0);
|
||||
session.createQueue(new QueueConfiguration(name));
|
||||
session.createQueue(QueueConfiguration.of(name));
|
||||
ClientProducer producer = session.createProducer();
|
||||
ClientProducer producer2 = session2.createProducer();
|
||||
producer.send(name, session.createMessage(true));
|
||||
|
@ -216,7 +216,7 @@ public class LegacyLDAPSecuritySettingPluginListenerTest extends AbstractLdapTes
|
|||
String queue = "queue1";
|
||||
ClientSession session = cf.createSession("first", "secret", false, true, true, false, 0);
|
||||
ClientSession session2 = cf.createSession("second", "secret", false, true, true, false, 0);
|
||||
session.createQueue(new QueueConfiguration(queue));
|
||||
session.createQueue(QueueConfiguration.of(queue));
|
||||
ClientConsumer consumer = session.createConsumer(queue);
|
||||
consumer.receiveImmediate();
|
||||
consumer.close();
|
||||
|
@ -260,7 +260,7 @@ public class LegacyLDAPSecuritySettingPluginListenerTest extends AbstractLdapTes
|
|||
server.getConfiguration().setSecurityInvalidationInterval(0);
|
||||
server.start();
|
||||
String queue = "queue2";
|
||||
server.createQueue(new QueueConfiguration(queue).setRoutingType(RoutingType.ANYCAST).setDurable(false));
|
||||
server.createQueue(QueueConfiguration.of(queue).setRoutingType(RoutingType.ANYCAST).setDurable(false));
|
||||
ClientSessionFactory cf = locator.createSessionFactory();
|
||||
ClientSession session = cf.createSession("first", "secret", false, true, true, false, 0);
|
||||
|
||||
|
@ -310,7 +310,7 @@ public class LegacyLDAPSecuritySettingPluginListenerTest extends AbstractLdapTes
|
|||
server.getConfiguration().setSecurityInvalidationInterval(0);
|
||||
server.start();
|
||||
String queue = "queue2";
|
||||
server.createQueue(new QueueConfiguration(queue).setRoutingType(RoutingType.ANYCAST).setDurable(false));
|
||||
server.createQueue(QueueConfiguration.of(queue).setRoutingType(RoutingType.ANYCAST).setDurable(false));
|
||||
ClientSessionFactory cf = locator.createSessionFactory();
|
||||
ClientSession session = cf.createSession("first", "secret", false, true, true, false, 0);
|
||||
ClientProducer producer = session.createProducer(SimpleString.of(queue));
|
||||
|
@ -363,7 +363,7 @@ public class LegacyLDAPSecuritySettingPluginListenerTest extends AbstractLdapTes
|
|||
server.getConfiguration().setSecurityInvalidationInterval(0);
|
||||
server.start();
|
||||
String queue = "queue1";
|
||||
server.createQueue(new QueueConfiguration(queue).setRoutingType(RoutingType.ANYCAST).setDurable(false));
|
||||
server.createQueue(QueueConfiguration.of(queue).setRoutingType(RoutingType.ANYCAST).setDurable(false));
|
||||
ClientSessionFactory cf = locator.createSessionFactory();
|
||||
|
||||
// authentication should fail
|
||||
|
@ -504,7 +504,7 @@ public class LegacyLDAPSecuritySettingPluginListenerTest extends AbstractLdapTes
|
|||
ctx.bind("cn=write,cn=" + goodQueue + ",ou=queues,ou=destinations,o=ActiveMQ,ou=system", null, basicAttributes);
|
||||
}
|
||||
|
||||
server.createQueue(new QueueConfiguration(goodQueue).setRoutingType(RoutingType.ANYCAST).setDurable(false));
|
||||
server.createQueue(QueueConfiguration.of(goodQueue).setRoutingType(RoutingType.ANYCAST).setDurable(false));
|
||||
|
||||
ClientSession session = cf.createSession(USERNAME, "secret", false, true, true, false, 0);
|
||||
|
||||
|
@ -518,7 +518,7 @@ public class LegacyLDAPSecuritySettingPluginListenerTest extends AbstractLdapTes
|
|||
}, 2000, 100);
|
||||
session.close();
|
||||
|
||||
server.createQueue(new QueueConfiguration(badQueue).setRoutingType(RoutingType.ANYCAST).setDurable(false));
|
||||
server.createQueue(QueueConfiguration.of(badQueue).setRoutingType(RoutingType.ANYCAST).setDurable(false));
|
||||
|
||||
// authorization for sending should fail for the new queue
|
||||
try {
|
||||
|
|
|
@ -189,7 +189,7 @@ public class LegacyLDAPSecuritySettingPluginListenerTest2 extends AbstractLdapTe
|
|||
// authz should succeed
|
||||
try {
|
||||
ClientSession session = cf.createSession("user5", "secret", false, true, true, false, 0);
|
||||
session.createQueue(new QueueConfiguration("project5.test"));
|
||||
session.createQueue(QueueConfiguration.of("project5.test"));
|
||||
} catch (ActiveMQException e) {
|
||||
Assert.fail("Should NOT fail");
|
||||
}
|
||||
|
@ -206,7 +206,7 @@ public class LegacyLDAPSecuritySettingPluginListenerTest2 extends AbstractLdapTe
|
|||
// authz should fail
|
||||
try {
|
||||
ClientSession session = cf.createSession("userFoo", "secret", false, true, true, false, 0);
|
||||
session.createQueue(new QueueConfiguration("project5.foo"));
|
||||
session.createQueue(QueueConfiguration.of("project5.foo"));
|
||||
Assert.fail("Creating queue here should fail!");
|
||||
} catch (ActiveMQException e) {
|
||||
Assert.assertTrue(e.getMessage().contains("229213")); // authorization exception
|
||||
|
|
|
@ -153,7 +153,7 @@ public class LegacyLDAPSecuritySettingPluginTest extends AbstractLdapTestUnit {
|
|||
|
||||
try {
|
||||
ClientSession session = cf.createSession("first", "secret", false, true, true, false, 0);
|
||||
session.createQueue(new QueueConfiguration(name));
|
||||
session.createQueue(QueueConfiguration.of(name));
|
||||
ClientProducer producer = session.createProducer();
|
||||
producer.send(name, session.createMessage(false));
|
||||
session.close();
|
||||
|
@ -171,14 +171,14 @@ public class LegacyLDAPSecuritySettingPluginTest extends AbstractLdapTestUnit {
|
|||
final SimpleString QUEUE = SimpleString.of("queue2");
|
||||
|
||||
server.start();
|
||||
server.createQueue(new QueueConfiguration(QUEUE).setAddress(ADDRESS).setRoutingType(RoutingType.ANYCAST));
|
||||
server.createQueue(QueueConfiguration.of(QUEUE).setAddress(ADDRESS).setRoutingType(RoutingType.ANYCAST));
|
||||
|
||||
ClientSessionFactory cf = locator.createSessionFactory();
|
||||
ClientSession session = cf.createSession("second", "secret", false, true, true, false, 0);
|
||||
|
||||
// CREATE_DURABLE_QUEUE
|
||||
try {
|
||||
session.createQueue(new QueueConfiguration(QUEUE).setAddress(ADDRESS));
|
||||
session.createQueue(QueueConfiguration.of(QUEUE).setAddress(ADDRESS));
|
||||
Assert.fail("should throw exception here");
|
||||
} catch (ActiveMQException e) {
|
||||
// ignore
|
||||
|
@ -194,7 +194,7 @@ public class LegacyLDAPSecuritySettingPluginTest extends AbstractLdapTestUnit {
|
|||
|
||||
// CREATE_NON_DURABLE_QUEUE
|
||||
try {
|
||||
session.createQueue(new QueueConfiguration(QUEUE).setAddress(ADDRESS).setDurable(false));
|
||||
session.createQueue(QueueConfiguration.of(QUEUE).setAddress(ADDRESS).setDurable(false));
|
||||
Assert.fail("should throw exception here");
|
||||
} catch (ActiveMQException e) {
|
||||
// ignore
|
||||
|
@ -249,7 +249,7 @@ public class LegacyLDAPSecuritySettingPluginTest extends AbstractLdapTestUnit {
|
|||
|
||||
// CREATE_DURABLE_QUEUE
|
||||
try {
|
||||
session.createQueue(new QueueConfiguration(QUEUE).setAddress(ADDRESS));
|
||||
session.createQueue(QueueConfiguration.of(QUEUE).setAddress(ADDRESS));
|
||||
} catch (ActiveMQException e) {
|
||||
e.printStackTrace();
|
||||
Assert.fail("should not throw exception here");
|
||||
|
@ -265,7 +265,7 @@ public class LegacyLDAPSecuritySettingPluginTest extends AbstractLdapTestUnit {
|
|||
|
||||
// CREATE_NON_DURABLE_QUEUE
|
||||
try {
|
||||
session.createQueue(new QueueConfiguration(QUEUE).setAddress(ADDRESS).setDurable(false));
|
||||
session.createQueue(QueueConfiguration.of(QUEUE).setAddress(ADDRESS).setDurable(false));
|
||||
} catch (ActiveMQException e) {
|
||||
Assert.fail("should not throw exception here");
|
||||
}
|
||||
|
@ -277,7 +277,7 @@ public class LegacyLDAPSecuritySettingPluginTest extends AbstractLdapTestUnit {
|
|||
Assert.fail("should not throw exception here");
|
||||
}
|
||||
|
||||
session.createQueue(new QueueConfiguration(QUEUE).setAddress(ADDRESS));
|
||||
session.createQueue(QueueConfiguration.of(QUEUE).setAddress(ADDRESS));
|
||||
|
||||
// PRODUCE
|
||||
try {
|
||||
|
|
|
@ -164,7 +164,7 @@ public class LegacyLDAPSecuritySettingPluginTest2 extends AbstractLdapTestUnit {
|
|||
|
||||
try {
|
||||
ClientSession session = cf.createSession("admin", "secret", false, true, true, false, 0);
|
||||
session.createQueue(new QueueConfiguration(name));
|
||||
session.createQueue(QueueConfiguration.of(name));
|
||||
ClientProducer producer = session.createProducer();
|
||||
producer.send(name, session.createMessage(false));
|
||||
session.close();
|
||||
|
|
|
@ -90,7 +90,7 @@ public class DuplicateDetectionTest extends ActiveMQTestBase {
|
|||
|
||||
final SimpleString queueName = SimpleString.of("DuplicateDetectionTestQueue");
|
||||
|
||||
session.createQueue(new QueueConfiguration(queueName).setDurable(false));
|
||||
session.createQueue(QueueConfiguration.of(queueName).setDurable(false));
|
||||
|
||||
ClientProducer producer = session.createProducer(queueName);
|
||||
|
||||
|
@ -160,7 +160,7 @@ public class DuplicateDetectionTest extends ActiveMQTestBase {
|
|||
|
||||
final SimpleString queueName = SimpleString.of("DuplicateDetectionTestQueue");
|
||||
|
||||
session.createQueue(new QueueConfiguration(queueName).setDurable(false));
|
||||
session.createQueue(QueueConfiguration.of(queueName).setDurable(false));
|
||||
|
||||
ClientProducer producer = session.createProducer(queueName);
|
||||
|
||||
|
@ -271,7 +271,7 @@ public class DuplicateDetectionTest extends ActiveMQTestBase {
|
|||
for (int i = 0; i < TEST_SIZE; i++) {
|
||||
final SimpleString queueName = SimpleString.of("DuplicateDetectionTestQueue_" + i);
|
||||
|
||||
session.createQueue(new QueueConfiguration(queueName).setAddress(addressName).setDurable(!temporary).setTemporary(temporary));
|
||||
session.createQueue(QueueConfiguration.of(queueName).setAddress(addressName).setDurable(!temporary).setTemporary(temporary));
|
||||
|
||||
ClientProducer producer = session.createProducer(addressName);
|
||||
|
||||
|
@ -337,7 +337,7 @@ public class DuplicateDetectionTest extends ActiveMQTestBase {
|
|||
session.start();
|
||||
|
||||
final SimpleString queueName = SimpleString.of("DuplicateDetectionTestQueue");
|
||||
session.createQueue(new QueueConfiguration(queueName));
|
||||
session.createQueue(QueueConfiguration.of(queueName));
|
||||
|
||||
ClientProducer producer = session.createProducer(queueName);
|
||||
|
||||
|
@ -391,7 +391,7 @@ public class DuplicateDetectionTest extends ActiveMQTestBase {
|
|||
|
||||
final SimpleString queueName = SimpleString.of("DuplicateDetectionTestQueue");
|
||||
|
||||
session.createQueue(new QueueConfiguration(queueName).setDurable(false));
|
||||
session.createQueue(QueueConfiguration.of(queueName).setDurable(false));
|
||||
|
||||
ClientProducer producer = session.createProducer(queueName);
|
||||
|
||||
|
@ -455,11 +455,11 @@ public class DuplicateDetectionTest extends ActiveMQTestBase {
|
|||
|
||||
final SimpleString queueName3 = SimpleString.of("DuplicateDetectionTestQueue3");
|
||||
|
||||
session.createQueue(new QueueConfiguration(queueName1).setDurable(false));
|
||||
session.createQueue(QueueConfiguration.of(queueName1).setDurable(false));
|
||||
|
||||
session.createQueue(new QueueConfiguration(queueName2).setDurable(false));
|
||||
session.createQueue(QueueConfiguration.of(queueName2).setDurable(false));
|
||||
|
||||
session.createQueue(new QueueConfiguration(queueName3).setDurable(false));
|
||||
session.createQueue(QueueConfiguration.of(queueName3).setDurable(false));
|
||||
|
||||
ClientProducer producer1 = session.createProducer(queueName1);
|
||||
ClientConsumer consumer1 = session.createConsumer(queueName1);
|
||||
|
@ -606,8 +606,8 @@ public class DuplicateDetectionTest extends ActiveMQTestBase {
|
|||
ClientSession session = sf.createSession(false, true, true);
|
||||
session.start();
|
||||
|
||||
session.createQueue(new QueueConfiguration(globalSettingsQueueName).setDurable(false));
|
||||
session.createQueue(new QueueConfiguration(addressSettingsQueueName).setDurable(false));
|
||||
session.createQueue(QueueConfiguration.of(globalSettingsQueueName).setDurable(false));
|
||||
session.createQueue(QueueConfiguration.of(addressSettingsQueueName).setDurable(false));
|
||||
|
||||
ClientProducer addressSettingsProducer = session.createProducer(addressSettingsQueueName);
|
||||
ClientConsumer addressSettingsConsumer = session.createConsumer(addressSettingsQueueName);
|
||||
|
@ -673,7 +673,7 @@ public class DuplicateDetectionTest extends ActiveMQTestBase {
|
|||
|
||||
final SimpleString queueName = SimpleString.of("DuplicateDetectionTestQueue");
|
||||
|
||||
session.createQueue(new QueueConfiguration(queueName).setDurable(false));
|
||||
session.createQueue(QueueConfiguration.of(queueName).setDurable(false));
|
||||
|
||||
ClientProducer producer = session.createProducer(queueName);
|
||||
|
||||
|
@ -715,7 +715,7 @@ public class DuplicateDetectionTest extends ActiveMQTestBase {
|
|||
|
||||
final SimpleString queueName = SimpleString.of("DuplicateDetectionTestQueue");
|
||||
|
||||
session.createQueue(new QueueConfiguration(queueName).setDurable(false));
|
||||
session.createQueue(QueueConfiguration.of(queueName).setDurable(false));
|
||||
|
||||
ClientProducer producer = session.createProducer(queueName);
|
||||
|
||||
|
@ -751,7 +751,7 @@ public class DuplicateDetectionTest extends ActiveMQTestBase {
|
|||
|
||||
final SimpleString queueName = SimpleString.of("DuplicateDetectionTestQueue");
|
||||
|
||||
session.createQueue(new QueueConfiguration(queueName).setDurable(false));
|
||||
session.createQueue(QueueConfiguration.of(queueName).setDurable(false));
|
||||
|
||||
ClientProducer producer = session.createProducer(queueName);
|
||||
|
||||
|
@ -803,7 +803,7 @@ public class DuplicateDetectionTest extends ActiveMQTestBase {
|
|||
|
||||
final SimpleString queueName = SimpleString.of("DuplicateDetectionTestQueue");
|
||||
|
||||
session.createQueue(new QueueConfiguration(queueName).setDurable(false));
|
||||
session.createQueue(QueueConfiguration.of(queueName).setDurable(false));
|
||||
|
||||
ClientProducer producer = session.createProducer(queueName);
|
||||
|
||||
|
@ -843,9 +843,9 @@ public class DuplicateDetectionTest extends ActiveMQTestBase {
|
|||
|
||||
final SimpleString queue2 = SimpleString.of("queue2");
|
||||
|
||||
session.createQueue(new QueueConfiguration(queueName).setDurable(false));
|
||||
session.createQueue(QueueConfiguration.of(queueName).setDurable(false));
|
||||
|
||||
session.createQueue(new QueueConfiguration(queue2).setDurable(false));
|
||||
session.createQueue(QueueConfiguration.of(queue2).setDurable(false));
|
||||
|
||||
ClientProducer producer = session.createProducer(queueName);
|
||||
|
||||
|
@ -923,7 +923,7 @@ public class DuplicateDetectionTest extends ActiveMQTestBase {
|
|||
|
||||
final SimpleString queueName = SimpleString.of("DuplicateDetectionTestQueue");
|
||||
|
||||
session.createQueue(new QueueConfiguration(queueName).setDurable(false));
|
||||
session.createQueue(QueueConfiguration.of(queueName).setDurable(false));
|
||||
|
||||
ClientProducer producer = session.createProducer(queueName);
|
||||
|
||||
|
@ -992,7 +992,7 @@ public class DuplicateDetectionTest extends ActiveMQTestBase {
|
|||
|
||||
final SimpleString queueName = SimpleString.of("DuplicateDetectionTestQueue");
|
||||
|
||||
session.createQueue(new QueueConfiguration(queueName).setDurable(false));
|
||||
session.createQueue(QueueConfiguration.of(queueName).setDurable(false));
|
||||
|
||||
ClientProducer producer = session.createProducer(queueName);
|
||||
|
||||
|
@ -1063,7 +1063,7 @@ public class DuplicateDetectionTest extends ActiveMQTestBase {
|
|||
|
||||
final SimpleString queueName = SimpleString.of("DuplicateDetectionTestQueue");
|
||||
|
||||
session.createQueue(new QueueConfiguration(queueName).setDurable(false));
|
||||
session.createQueue(QueueConfiguration.of(queueName).setDurable(false));
|
||||
|
||||
ClientProducer producer = session.createProducer(queueName);
|
||||
|
||||
|
@ -1133,7 +1133,7 @@ public class DuplicateDetectionTest extends ActiveMQTestBase {
|
|||
|
||||
final SimpleString queueName = SimpleString.of("DuplicateDetectionTestQueue");
|
||||
|
||||
session.createQueue(new QueueConfiguration(queueName).setDurable(false));
|
||||
session.createQueue(QueueConfiguration.of(queueName).setDurable(false));
|
||||
|
||||
ClientProducer producer = session.createProducer(queueName);
|
||||
|
||||
|
@ -1195,7 +1195,7 @@ public class DuplicateDetectionTest extends ActiveMQTestBase {
|
|||
|
||||
final SimpleString queueName = SimpleString.of("DuplicateDetectionTestQueue");
|
||||
|
||||
session.createQueue(new QueueConfiguration(queueName));
|
||||
session.createQueue(QueueConfiguration.of(queueName));
|
||||
|
||||
ClientProducer producer = session.createProducer(queueName);
|
||||
|
||||
|
@ -1273,7 +1273,7 @@ public class DuplicateDetectionTest extends ActiveMQTestBase {
|
|||
|
||||
final SimpleString queueName = SimpleString.of("DuplicateDetectionTestQueue");
|
||||
|
||||
session.createQueue(new QueueConfiguration(queueName).setDurable(false));
|
||||
session.createQueue(QueueConfiguration.of(queueName).setDurable(false));
|
||||
|
||||
ClientProducer producer = session.createProducer(queueName);
|
||||
|
||||
|
@ -1364,7 +1364,7 @@ public class DuplicateDetectionTest extends ActiveMQTestBase {
|
|||
|
||||
final SimpleString queueName = SimpleString.of("DuplicateDetectionTestQueue");
|
||||
|
||||
session.createQueue(new QueueConfiguration(queueName).setDurable(false));
|
||||
session.createQueue(QueueConfiguration.of(queueName).setDurable(false));
|
||||
|
||||
ClientProducer producer = session.createProducer(queueName);
|
||||
|
||||
|
@ -1400,7 +1400,7 @@ public class DuplicateDetectionTest extends ActiveMQTestBase {
|
|||
|
||||
session.start();
|
||||
|
||||
session.createQueue(new QueueConfiguration(queueName).setDurable(false));
|
||||
session.createQueue(QueueConfiguration.of(queueName).setDurable(false));
|
||||
|
||||
producer = session.createProducer(queueName);
|
||||
|
||||
|
@ -1439,7 +1439,7 @@ public class DuplicateDetectionTest extends ActiveMQTestBase {
|
|||
|
||||
final SimpleString queueName = SimpleString.of("DuplicateDetectionTestQueue");
|
||||
|
||||
session.createQueue(new QueueConfiguration(queueName).setDurable(false));
|
||||
session.createQueue(QueueConfiguration.of(queueName).setDurable(false));
|
||||
|
||||
ClientProducer producer = session.createProducer(queueName);
|
||||
|
||||
|
@ -1470,7 +1470,7 @@ public class DuplicateDetectionTest extends ActiveMQTestBase {
|
|||
|
||||
session.start();
|
||||
|
||||
session.createQueue(new QueueConfiguration(queueName).setDurable(false));
|
||||
session.createQueue(QueueConfiguration.of(queueName).setDurable(false));
|
||||
|
||||
producer = session.createProducer(queueName);
|
||||
|
||||
|
@ -1504,7 +1504,7 @@ public class DuplicateDetectionTest extends ActiveMQTestBase {
|
|||
|
||||
final SimpleString queueName = SimpleString.of("DuplicateDetectionTestQueue");
|
||||
|
||||
session.createQueue(new QueueConfiguration(queueName).setDurable(false));
|
||||
session.createQueue(QueueConfiguration.of(queueName).setDurable(false));
|
||||
|
||||
ClientProducer producer = session.createProducer(queueName);
|
||||
|
||||
|
@ -1540,7 +1540,7 @@ public class DuplicateDetectionTest extends ActiveMQTestBase {
|
|||
|
||||
session.start();
|
||||
|
||||
session.createQueue(new QueueConfiguration(queueName).setDurable(false));
|
||||
session.createQueue(QueueConfiguration.of(queueName).setDurable(false));
|
||||
|
||||
producer = session.createProducer(queueName);
|
||||
|
||||
|
@ -1577,7 +1577,7 @@ public class DuplicateDetectionTest extends ActiveMQTestBase {
|
|||
|
||||
final SimpleString queueName = SimpleString.of("DuplicateDetectionTestQueue");
|
||||
|
||||
session.createQueue(new QueueConfiguration(queueName).setDurable(false));
|
||||
session.createQueue(QueueConfiguration.of(queueName).setDurable(false));
|
||||
|
||||
ClientProducer producer = session.createProducer(queueName);
|
||||
|
||||
|
@ -1615,7 +1615,7 @@ public class DuplicateDetectionTest extends ActiveMQTestBase {
|
|||
|
||||
session.start();
|
||||
|
||||
session.createQueue(new QueueConfiguration(queueName).setDurable(false));
|
||||
session.createQueue(QueueConfiguration.of(queueName).setDurable(false));
|
||||
|
||||
producer = session.createProducer(queueName);
|
||||
|
||||
|
@ -1645,7 +1645,7 @@ public class DuplicateDetectionTest extends ActiveMQTestBase {
|
|||
|
||||
final SimpleString queueName = SimpleString.of("DuplicateDetectionTestQueue");
|
||||
|
||||
session.createQueue(new QueueConfiguration(queueName).setDurable(false));
|
||||
session.createQueue(QueueConfiguration.of(queueName).setDurable(false));
|
||||
|
||||
ClientProducer producer = session.createProducer(queueName);
|
||||
|
||||
|
@ -1687,7 +1687,7 @@ public class DuplicateDetectionTest extends ActiveMQTestBase {
|
|||
|
||||
session.start();
|
||||
|
||||
session.createQueue(new QueueConfiguration(queueName).setDurable(false));
|
||||
session.createQueue(QueueConfiguration.of(queueName).setDurable(false));
|
||||
|
||||
producer = session.createProducer(queueName);
|
||||
|
||||
|
@ -1746,7 +1746,7 @@ public class DuplicateDetectionTest extends ActiveMQTestBase {
|
|||
|
||||
final SimpleString queueName = SimpleString.of("DuplicateDetectionTestQueue");
|
||||
|
||||
session.createQueue(new QueueConfiguration(queueName).setDurable(false));
|
||||
session.createQueue(QueueConfiguration.of(queueName).setDurable(false));
|
||||
|
||||
ClientProducer producer = session.createProducer(queueName);
|
||||
|
||||
|
@ -1786,7 +1786,7 @@ public class DuplicateDetectionTest extends ActiveMQTestBase {
|
|||
|
||||
session.start();
|
||||
|
||||
session.createQueue(new QueueConfiguration(queueName).setDurable(false));
|
||||
session.createQueue(QueueConfiguration.of(queueName).setDurable(false));
|
||||
|
||||
producer = session.createProducer(queueName);
|
||||
|
||||
|
@ -1827,7 +1827,7 @@ public class DuplicateDetectionTest extends ActiveMQTestBase {
|
|||
|
||||
final SimpleString queueName = SimpleString.of("DuplicateDetectionTestQueue");
|
||||
|
||||
session.createQueue(new QueueConfiguration(queueName).setDurable(false));
|
||||
session.createQueue(QueueConfiguration.of(queueName).setDurable(false));
|
||||
|
||||
ClientProducer producer = session.createProducer(queueName);
|
||||
|
||||
|
@ -1863,7 +1863,7 @@ public class DuplicateDetectionTest extends ActiveMQTestBase {
|
|||
|
||||
session.start();
|
||||
|
||||
session.createQueue(new QueueConfiguration(queueName).setDurable(false));
|
||||
session.createQueue(QueueConfiguration.of(queueName).setDurable(false));
|
||||
|
||||
producer = session.createProducer(queueName);
|
||||
|
||||
|
@ -1906,7 +1906,7 @@ public class DuplicateDetectionTest extends ActiveMQTestBase {
|
|||
|
||||
final SimpleString queueName = SimpleString.of("DuplicateDetectionTestQueue");
|
||||
|
||||
session.createQueue(new QueueConfiguration(queueName).setDurable(false));
|
||||
session.createQueue(QueueConfiguration.of(queueName).setDurable(false));
|
||||
|
||||
ClientProducer producer = session.createProducer(queueName);
|
||||
|
||||
|
@ -1946,7 +1946,7 @@ public class DuplicateDetectionTest extends ActiveMQTestBase {
|
|||
|
||||
session.start();
|
||||
|
||||
session.createQueue(new QueueConfiguration(queueName).setDurable(false));
|
||||
session.createQueue(QueueConfiguration.of(queueName).setDurable(false));
|
||||
|
||||
producer = session.createProducer(queueName);
|
||||
|
||||
|
|
|
@ -106,7 +106,7 @@ public class MultiThreadedAuditLoggingTest extends ActiveMQTestBase {
|
|||
|
||||
try {
|
||||
try {
|
||||
session.createQueue(new QueueConfiguration(queue).setRoutingType(RoutingType.ANYCAST));
|
||||
session.createQueue(QueueConfiguration.of(queue).setRoutingType(RoutingType.ANYCAST));
|
||||
} catch (Exception e) {
|
||||
// ignore
|
||||
}
|
||||
|
@ -160,7 +160,7 @@ public class MultiThreadedAuditLoggingTest extends ActiveMQTestBase {
|
|||
|
||||
try {
|
||||
try {
|
||||
session.createQueue(new QueueConfiguration(queue).setRoutingType(RoutingType.ANYCAST));
|
||||
session.createQueue(QueueConfiguration.of(queue).setRoutingType(RoutingType.ANYCAST));
|
||||
} catch (Exception e) {
|
||||
// ignore
|
||||
}
|
||||
|
|
|
@ -91,7 +91,7 @@ public class SimpleTest extends ActiveMQTestBase {
|
|||
final String addressName = "simpleAddress";
|
||||
|
||||
// Create a queue bound to a particular address where the test will send to & consume from.
|
||||
session.createQueue(new QueueConfiguration(queueName).setAddress(addressName).setRoutingType(RoutingType.ANYCAST));
|
||||
session.createQueue(QueueConfiguration.of(queueName).setAddress(addressName).setRoutingType(RoutingType.ANYCAST));
|
||||
|
||||
// Create a producer to send a message to the previously created address.
|
||||
ClientProducer producer = session.createProducer(addressName);
|
||||
|
|
|
@ -48,7 +48,7 @@ public class SingleServerSimpleTest extends SingleServerTestBase {
|
|||
final String addressName = "simpleAddress";
|
||||
|
||||
// Create a queue bound to a particular address where the test will send to & consume from.
|
||||
session.createQueue(new QueueConfiguration(queueName).setAddress(addressName).setRoutingType(RoutingType.ANYCAST));
|
||||
session.createQueue(QueueConfiguration.of(queueName).setAddress(addressName).setRoutingType(RoutingType.ANYCAST));
|
||||
|
||||
// Create a producer to send a message to the previously created address.
|
||||
ClientProducer producer = session.createProducer(addressName);
|
||||
|
|
|
@ -67,7 +67,7 @@ public class String64KLimitTest extends ActiveMQTestBase {
|
|||
SimpleString address = RandomUtil.randomSimpleString();
|
||||
SimpleString queue = RandomUtil.randomSimpleString();
|
||||
|
||||
session.createQueue(new QueueConfiguration(queue).setAddress(address).setDurable(false));
|
||||
session.createQueue(QueueConfiguration.of(queue).setAddress(address).setDurable(false));
|
||||
|
||||
ClientProducer producer = session.createProducer(address);
|
||||
ClientConsumer consumer = session.createConsumer(queue);
|
||||
|
@ -131,7 +131,7 @@ public class String64KLimitTest extends ActiveMQTestBase {
|
|||
SimpleString address = RandomUtil.randomSimpleString();
|
||||
SimpleString queue = RandomUtil.randomSimpleString();
|
||||
|
||||
session.createQueue(new QueueConfiguration(queue).setAddress(address).setDurable(false));
|
||||
session.createQueue(QueueConfiguration.of(queue).setAddress(address).setDurable(false));
|
||||
|
||||
ClientProducer producer = session.createProducer(address);
|
||||
ClientConsumer consumer = session.createConsumer(queue);
|
||||
|
|
|
@ -50,7 +50,7 @@ public class AddressConfigTest extends ActiveMQTestBase {
|
|||
|
||||
@Test
|
||||
public void persistAddressConfigTest() throws Exception {
|
||||
server.createQueue(new QueueConfiguration("myQueue").setAddress("myAddress"));
|
||||
server.createQueue(QueueConfiguration.of("myQueue").setAddress("myAddress"));
|
||||
server.stop();
|
||||
server.start();
|
||||
AddressInfo addressInfo = server.getAddressInfo(SimpleString.of("myAddress"));
|
||||
|
|
|
@ -80,8 +80,8 @@ public class AddressingTest extends ActiveMQTestBase {
|
|||
addressInfo.addRoutingType(RoutingType.MULTICAST);
|
||||
|
||||
server.addOrUpdateAddressInfo(addressInfo);
|
||||
Queue q1 = server.createQueue(new QueueConfiguration(SimpleString.of(consumeAddress + ".1")).setAddress(SimpleString.of(consumeAddress)).setRoutingType(RoutingType.MULTICAST));
|
||||
Queue q2 = server.createQueue(new QueueConfiguration(SimpleString.of(consumeAddress + ".2")).setAddress(SimpleString.of(consumeAddress)).setRoutingType(RoutingType.MULTICAST));
|
||||
Queue q1 = server.createQueue(QueueConfiguration.of(consumeAddress + ".1").setAddress(consumeAddress).setRoutingType(RoutingType.MULTICAST));
|
||||
Queue q2 = server.createQueue(QueueConfiguration.of(consumeAddress + ".2").setAddress(consumeAddress).setRoutingType(RoutingType.MULTICAST));
|
||||
|
||||
ClientSession session = sessionFactory.createSession();
|
||||
session.start();
|
||||
|
@ -112,8 +112,8 @@ public class AddressingTest extends ActiveMQTestBase {
|
|||
addressInfo.addRoutingType(RoutingType.MULTICAST);
|
||||
|
||||
server.addOrUpdateAddressInfo(addressInfo);
|
||||
Queue q1 = server.createQueue(new QueueConfiguration(SimpleString.of("1.test.address")).setAddress("test.address").setRoutingType(RoutingType.MULTICAST));
|
||||
Queue q2 = server.createQueue(new QueueConfiguration(SimpleString.of("2.test.#")).setAddress("test.#").setRoutingType(RoutingType.MULTICAST));
|
||||
Queue q1 = server.createQueue(QueueConfiguration.of("1.test.address").setAddress("test.address").setRoutingType(RoutingType.MULTICAST));
|
||||
Queue q2 = server.createQueue(QueueConfiguration.of("2.test.#").setAddress("test.#").setRoutingType(RoutingType.MULTICAST));
|
||||
|
||||
ClientSession session = sessionFactory.createSession();
|
||||
session.start();
|
||||
|
@ -133,7 +133,7 @@ public class AddressingTest extends ActiveMQTestBase {
|
|||
assertNotNull(consumer2.receive(2000));
|
||||
|
||||
// add in a new wildcard producer, bindings version will be incremented
|
||||
Queue q3 = server.createQueue(new QueueConfiguration(SimpleString.of("3.test.*")).setAddress("test.*").setRoutingType(RoutingType.MULTICAST));
|
||||
Queue q3 = server.createQueue(QueueConfiguration.of("3.test.*").setAddress("test.*").setRoutingType(RoutingType.MULTICAST));
|
||||
ClientConsumer consumer3 = session.createConsumer(q3.getName());
|
||||
|
||||
producer.send(m);
|
||||
|
@ -162,8 +162,8 @@ public class AddressingTest extends ActiveMQTestBase {
|
|||
addressInfo.addRoutingType(RoutingType.ANYCAST);
|
||||
|
||||
server.addOrUpdateAddressInfo(addressInfo);
|
||||
Queue q1 = server.createQueue(new QueueConfiguration(SimpleString.of(consumeAddress + ".1")).setAddress(SimpleString.of(consumeAddress)).setRoutingType(RoutingType.ANYCAST).setMaxConsumers(Queue.MAX_CONSUMERS_UNLIMITED));
|
||||
Queue q2 = server.createQueue(new QueueConfiguration(SimpleString.of(consumeAddress + ".2")).setAddress(SimpleString.of(consumeAddress)).setRoutingType(RoutingType.ANYCAST).setMaxConsumers(Queue.MAX_CONSUMERS_UNLIMITED));
|
||||
Queue q1 = server.createQueue(QueueConfiguration.of(consumeAddress + ".1").setAddress(consumeAddress).setRoutingType(RoutingType.ANYCAST).setMaxConsumers(Queue.MAX_CONSUMERS_UNLIMITED));
|
||||
Queue q2 = server.createQueue(QueueConfiguration.of(consumeAddress + ".2").setAddress(consumeAddress).setRoutingType(RoutingType.ANYCAST).setMaxConsumers(Queue.MAX_CONSUMERS_UNLIMITED));
|
||||
|
||||
ClientSession session = sessionFactory.createSession();
|
||||
session.start();
|
||||
|
@ -196,9 +196,9 @@ public class AddressingTest extends ActiveMQTestBase {
|
|||
addressInfo.addRoutingType(RoutingType.ANYCAST);
|
||||
|
||||
server.addOrUpdateAddressInfo(addressInfo);
|
||||
Queue q1 = server.createQueue(new QueueConfiguration(address.concat(".1")).setAddress(address).setRoutingType(RoutingType.ANYCAST).setMaxConsumers(Queue.MAX_CONSUMERS_UNLIMITED));
|
||||
Queue q2 = server.createQueue(new QueueConfiguration(address.concat(".2")).setAddress(address).setRoutingType(RoutingType.ANYCAST).setMaxConsumers(Queue.MAX_CONSUMERS_UNLIMITED));
|
||||
Queue q3 = server.createQueue(new QueueConfiguration(address.concat(".3")).setAddress(address).setRoutingType(RoutingType.ANYCAST).setMaxConsumers(Queue.MAX_CONSUMERS_UNLIMITED));
|
||||
Queue q1 = server.createQueue(QueueConfiguration.of(address.concat(".1")).setAddress(address).setRoutingType(RoutingType.ANYCAST).setMaxConsumers(Queue.MAX_CONSUMERS_UNLIMITED));
|
||||
Queue q2 = server.createQueue(QueueConfiguration.of(address.concat(".2")).setAddress(address).setRoutingType(RoutingType.ANYCAST).setMaxConsumers(Queue.MAX_CONSUMERS_UNLIMITED));
|
||||
Queue q3 = server.createQueue(QueueConfiguration.of(address.concat(".3")).setAddress(address).setRoutingType(RoutingType.ANYCAST).setMaxConsumers(Queue.MAX_CONSUMERS_UNLIMITED));
|
||||
|
||||
ClientSession session = sessionFactory.createSession();
|
||||
session.start();
|
||||
|
@ -249,8 +249,8 @@ public class AddressingTest extends ActiveMQTestBase {
|
|||
for (String consumeAddress : testAddresses) {
|
||||
|
||||
// For each address, create 2 Queues with the same address, assert both queues receive message
|
||||
Queue q1 = server.createQueue(new QueueConfiguration(SimpleString.of(consumeAddress + ".1")).setAddress(SimpleString.of(consumeAddress)).setRoutingType(RoutingType.MULTICAST));
|
||||
Queue q2 = server.createQueue(new QueueConfiguration(SimpleString.of(consumeAddress + ".2")).setAddress(SimpleString.of(consumeAddress)).setRoutingType(RoutingType.MULTICAST));
|
||||
Queue q1 = server.createQueue(QueueConfiguration.of(consumeAddress + ".1").setAddress(consumeAddress).setRoutingType(RoutingType.MULTICAST));
|
||||
Queue q2 = server.createQueue(QueueConfiguration.of(consumeAddress + ".2").setAddress(consumeAddress).setRoutingType(RoutingType.MULTICAST));
|
||||
|
||||
ClientSession session = sessionFactory.createSession();
|
||||
session.start();
|
||||
|
@ -276,7 +276,7 @@ public class AddressingTest extends ActiveMQTestBase {
|
|||
public void testPurgeOnNoConsumersTrue() throws Exception {
|
||||
SimpleString address = SimpleString.of("test.address");
|
||||
SimpleString queueName = SimpleString.of(UUID.randomUUID().toString());
|
||||
server.createQueue(new QueueConfiguration(queueName).setAddress(address).setRoutingType(RoutingType.ANYCAST).setMaxConsumers(1).setPurgeOnNoConsumers(true));
|
||||
server.createQueue(QueueConfiguration.of(queueName).setAddress(address).setRoutingType(RoutingType.ANYCAST).setMaxConsumers(1).setPurgeOnNoConsumers(true));
|
||||
Queue queue = server.locateQueue(queueName);
|
||||
assertNotNull(queue);
|
||||
ClientSession session = sessionFactory.createSession();
|
||||
|
@ -306,7 +306,7 @@ public class AddressingTest extends ActiveMQTestBase {
|
|||
public void testPurgeOnNoConsumersFalse() throws Exception {
|
||||
SimpleString address = SimpleString.of("test.address");
|
||||
SimpleString queueName = SimpleString.of(UUID.randomUUID().toString());
|
||||
server.createQueue(new QueueConfiguration(queueName).setAddress(address).setRoutingType(RoutingType.ANYCAST).setMaxConsumers(1));
|
||||
server.createQueue(QueueConfiguration.of(queueName).setAddress(address).setRoutingType(RoutingType.ANYCAST).setMaxConsumers(1));
|
||||
assertNotNull(server.locateQueue(queueName));
|
||||
ClientSession session = sessionFactory.createSession();
|
||||
ClientProducer producer = session.createProducer(address);
|
||||
|
@ -327,9 +327,9 @@ public class AddressingTest extends ActiveMQTestBase {
|
|||
|
||||
//Validate default is enabled, and check that queues enabled receive messages and disabled do not on same address.
|
||||
|
||||
server.createQueue(new QueueConfiguration(defaultQueue).setAddress(address).setRoutingType(RoutingType.MULTICAST));
|
||||
server.createQueue(new QueueConfiguration(enabledQueue).setAddress(address).setRoutingType(RoutingType.MULTICAST).setEnabled(true));
|
||||
server.createQueue(new QueueConfiguration(disabledQueue).setAddress(address).setRoutingType(RoutingType.MULTICAST).setEnabled(false));
|
||||
server.createQueue(QueueConfiguration.of(defaultQueue).setAddress(address).setRoutingType(RoutingType.MULTICAST));
|
||||
server.createQueue(QueueConfiguration.of(enabledQueue).setAddress(address).setRoutingType(RoutingType.MULTICAST).setEnabled(true));
|
||||
server.createQueue(QueueConfiguration.of(disabledQueue).setAddress(address).setRoutingType(RoutingType.MULTICAST).setEnabled(false));
|
||||
|
||||
assertNotNull(server.locateQueue(defaultQueue));
|
||||
assertNotNull(server.locateQueue(enabledQueue));
|
||||
|
@ -347,9 +347,9 @@ public class AddressingTest extends ActiveMQTestBase {
|
|||
Wait.assertEquals(0, server.locateQueue(disabledQueue)::getMessageCount);
|
||||
|
||||
//Update Queue Disable All
|
||||
server.updateQueue(new QueueConfiguration(defaultQueue).setAddress(address).setRoutingType(RoutingType.MULTICAST).setEnabled(false));
|
||||
server.updateQueue(new QueueConfiguration(enabledQueue).setAddress(address).setRoutingType(RoutingType.MULTICAST).setEnabled(false));
|
||||
server.updateQueue(new QueueConfiguration(disabledQueue).setAddress(address).setRoutingType(RoutingType.MULTICAST).setEnabled(false));
|
||||
server.updateQueue(QueueConfiguration.of(defaultQueue).setAddress(address).setRoutingType(RoutingType.MULTICAST).setEnabled(false));
|
||||
server.updateQueue(QueueConfiguration.of(enabledQueue).setAddress(address).setRoutingType(RoutingType.MULTICAST).setEnabled(false));
|
||||
server.updateQueue(QueueConfiguration.of(disabledQueue).setAddress(address).setRoutingType(RoutingType.MULTICAST).setEnabled(false));
|
||||
|
||||
producer.send(session.createMessage(true));
|
||||
|
||||
|
@ -359,9 +359,9 @@ public class AddressingTest extends ActiveMQTestBase {
|
|||
|
||||
|
||||
//Update Queue Enable All
|
||||
server.updateQueue(new QueueConfiguration(defaultQueue).setAddress(address).setRoutingType(RoutingType.MULTICAST).setEnabled(true));
|
||||
server.updateQueue(new QueueConfiguration(enabledQueue).setAddress(address).setRoutingType(RoutingType.MULTICAST).setEnabled(true));
|
||||
server.updateQueue(new QueueConfiguration(disabledQueue).setAddress(address).setRoutingType(RoutingType.MULTICAST).setEnabled(true));
|
||||
server.updateQueue(QueueConfiguration.of(defaultQueue).setAddress(address).setRoutingType(RoutingType.MULTICAST).setEnabled(true));
|
||||
server.updateQueue(QueueConfiguration.of(enabledQueue).setAddress(address).setRoutingType(RoutingType.MULTICAST).setEnabled(true));
|
||||
server.updateQueue(QueueConfiguration.of(disabledQueue).setAddress(address).setRoutingType(RoutingType.MULTICAST).setEnabled(true));
|
||||
|
||||
|
||||
producer.send(session.createMessage(true));
|
||||
|
@ -378,7 +378,7 @@ public class AddressingTest extends ActiveMQTestBase {
|
|||
SimpleString queueName = SimpleString.of(UUID.randomUUID().toString());
|
||||
// For each address, create 2 Queues with the same address, assert both queues receive message
|
||||
boolean purgeOnNoConsumers = false;
|
||||
Queue q1 = server.createQueue(new QueueConfiguration(queueName).setAddress(address).setMaxConsumers(0).setPurgeOnNoConsumers(purgeOnNoConsumers));
|
||||
Queue q1 = server.createQueue(QueueConfiguration.of(queueName).setAddress(address).setMaxConsumers(0).setPurgeOnNoConsumers(purgeOnNoConsumers));
|
||||
|
||||
Exception expectedException = null;
|
||||
String expectedMessage = "Maximum Consumer Limit Reached on Queue";
|
||||
|
@ -404,7 +404,7 @@ public class AddressingTest extends ActiveMQTestBase {
|
|||
SimpleString queueName = SimpleString.of(UUID.randomUUID().toString());
|
||||
// For each address, create 2 Queues with the same address, assert both queues receive message
|
||||
boolean purgeOnNoConsumers = false;
|
||||
Queue q1 = server.createQueue(new QueueConfiguration(queueName).setAddress(address).setMaxConsumers(Queue.MAX_CONSUMERS_UNLIMITED).setPurgeOnNoConsumers(purgeOnNoConsumers));
|
||||
Queue q1 = server.createQueue(QueueConfiguration.of(queueName).setAddress(address).setMaxConsumers(Queue.MAX_CONSUMERS_UNLIMITED).setPurgeOnNoConsumers(purgeOnNoConsumers));
|
||||
|
||||
ClientSession session = sessionFactory.createSession();
|
||||
session.start();
|
||||
|
|
|
@ -74,8 +74,8 @@ public class AnycastTest extends ActiveMQTestBase {
|
|||
@Test
|
||||
public void testTxCommitReceive() throws Exception {
|
||||
|
||||
Queue q1 = server.createQueue(new QueueConfiguration(baseAddress.concat(".1")).setAddress(baseAddress).setRoutingType(RoutingType.ANYCAST).setMaxConsumers(Queue.MAX_CONSUMERS_UNLIMITED));
|
||||
Queue q2 = server.createQueue(new QueueConfiguration(baseAddress.concat(".2")).setAddress(baseAddress).setRoutingType(RoutingType.ANYCAST).setMaxConsumers(Queue.MAX_CONSUMERS_UNLIMITED));
|
||||
Queue q1 = server.createQueue(QueueConfiguration.of(baseAddress.concat(".1")).setAddress(baseAddress).setRoutingType(RoutingType.ANYCAST).setMaxConsumers(Queue.MAX_CONSUMERS_UNLIMITED));
|
||||
Queue q2 = server.createQueue(QueueConfiguration.of(baseAddress.concat(".2")).setAddress(baseAddress).setRoutingType(RoutingType.ANYCAST).setMaxConsumers(Queue.MAX_CONSUMERS_UNLIMITED));
|
||||
|
||||
ClientSession session = sessionFactory.createSession(false, false);
|
||||
session.start();
|
||||
|
@ -121,8 +121,8 @@ public class AnycastTest extends ActiveMQTestBase {
|
|||
@Test
|
||||
public void testTxRollbackReceive() throws Exception {
|
||||
|
||||
Queue q1 = server.createQueue(new QueueConfiguration(baseAddress.concat(".1")).setAddress(baseAddress).setRoutingType(RoutingType.ANYCAST).setMaxConsumers(Queue.MAX_CONSUMERS_UNLIMITED));
|
||||
Queue q2 = server.createQueue(new QueueConfiguration(baseAddress.concat(".2")).setAddress(baseAddress).setRoutingType(RoutingType.ANYCAST).setMaxConsumers(Queue.MAX_CONSUMERS_UNLIMITED));
|
||||
Queue q1 = server.createQueue(QueueConfiguration.of(baseAddress.concat(".1")).setAddress(baseAddress).setRoutingType(RoutingType.ANYCAST).setMaxConsumers(Queue.MAX_CONSUMERS_UNLIMITED));
|
||||
Queue q2 = server.createQueue(QueueConfiguration.of(baseAddress.concat(".2")).setAddress(baseAddress).setRoutingType(RoutingType.ANYCAST).setMaxConsumers(Queue.MAX_CONSUMERS_UNLIMITED));
|
||||
|
||||
ClientSession session = sessionFactory.createSession(false, false);
|
||||
session.start();
|
||||
|
|
|
@ -76,8 +76,8 @@ public class MulticastTest extends ActiveMQTestBase {
|
|||
@Test
|
||||
public void testTxCommitReceive() throws Exception {
|
||||
|
||||
Queue q1 = server.createQueue(new QueueConfiguration(baseAddress.concat(".1")).setAddress(baseAddress).setMaxConsumers(Queue.MAX_CONSUMERS_UNLIMITED));
|
||||
Queue q2 = server.createQueue(new QueueConfiguration(baseAddress.concat(".2")).setAddress(baseAddress).setMaxConsumers(Queue.MAX_CONSUMERS_UNLIMITED));
|
||||
Queue q1 = server.createQueue(QueueConfiguration.of(baseAddress.concat(".1")).setAddress(baseAddress).setMaxConsumers(Queue.MAX_CONSUMERS_UNLIMITED));
|
||||
Queue q2 = server.createQueue(QueueConfiguration.of(baseAddress.concat(".2")).setAddress(baseAddress).setMaxConsumers(Queue.MAX_CONSUMERS_UNLIMITED));
|
||||
|
||||
ClientSession session = sessionFactory.createSession(false, false);
|
||||
session.start();
|
||||
|
@ -125,8 +125,8 @@ public class MulticastTest extends ActiveMQTestBase {
|
|||
@Test
|
||||
public void testTxRollbackReceive() throws Exception {
|
||||
|
||||
Queue q1 = server.createQueue(new QueueConfiguration(baseAddress.concat(".1")).setAddress(baseAddress).setMaxConsumers(Queue.MAX_CONSUMERS_UNLIMITED));
|
||||
Queue q2 = server.createQueue(new QueueConfiguration(baseAddress.concat(".2")).setAddress(baseAddress).setMaxConsumers(Queue.MAX_CONSUMERS_UNLIMITED));
|
||||
Queue q1 = server.createQueue(QueueConfiguration.of(baseAddress.concat(".1")).setAddress(baseAddress).setMaxConsumers(Queue.MAX_CONSUMERS_UNLIMITED));
|
||||
Queue q2 = server.createQueue(QueueConfiguration.of(baseAddress.concat(".2")).setAddress(baseAddress).setMaxConsumers(Queue.MAX_CONSUMERS_UNLIMITED));
|
||||
|
||||
ClientSession session = sessionFactory.createSession(false, false);
|
||||
session.start();
|
||||
|
|
|
@ -62,7 +62,7 @@ public class TwoWaysRemoveAddressTest extends ActiveMQTestBase {
|
|||
|
||||
for (int i = 0; i < retries; i++) {
|
||||
logger.debug("Removed queue on thread 1 ::{}", i);
|
||||
server.createQueue(new QueueConfiguration("queueName_1_" + i).setAddress("address_1_" + i).setRoutingType(RoutingType.ANYCAST));
|
||||
server.createQueue(QueueConfiguration.of("queueName_1_" + i).setAddress("address_1_" + i).setRoutingType(RoutingType.ANYCAST));
|
||||
server.destroyQueue(SimpleString.of("queueName_1_" + i));
|
||||
}
|
||||
} catch (Throwable e) {
|
||||
|
@ -81,7 +81,7 @@ public class TwoWaysRemoveAddressTest extends ActiveMQTestBase {
|
|||
|
||||
for (int i = 0; i < retries; i++) {
|
||||
logger.debug("Removed queue on thread 2 ::{}", i);
|
||||
server.createQueue(new QueueConfiguration("queueName_2_" + i).setAddress("address_2_" + i).setRoutingType(RoutingType.ANYCAST));
|
||||
server.createQueue(QueueConfiguration.of("queueName_2_" + i).setAddress("address_2_" + i).setRoutingType(RoutingType.ANYCAST));
|
||||
server.removeAddressInfo(SimpleString.of("address_2_" + i), null, true);
|
||||
}
|
||||
} catch (Throwable e) {
|
||||
|
|
|
@ -53,7 +53,7 @@ public class AmqpAnyCastDistinctQueueTest extends AmqpClientTestSupport {
|
|||
String ADDRESS_NAME = "DISTINCT_ADDRESS_testDistinctAddressAnyCast";
|
||||
String QUEUE_NAME = "DISTINCT_QUEUE_testDistinctQUEUE_AnyCast";
|
||||
server.addAddressInfo(new AddressInfo(ADDRESS_NAME).setAutoCreated(false).addRoutingType(RoutingType.ANYCAST));
|
||||
server.createQueue(new QueueConfiguration(QUEUE_NAME).setAddress(ADDRESS_NAME).setDurable(true).setRoutingType(RoutingType.ANYCAST));
|
||||
server.createQueue(QueueConfiguration.of(QUEUE_NAME).setAddress(ADDRESS_NAME).setDurable(true).setRoutingType(RoutingType.ANYCAST));
|
||||
|
||||
final int NUMBER_OF_MESSAGES = 100;
|
||||
|
||||
|
|
|
@ -122,10 +122,10 @@ public class AmqpBridgeApplicationPropertiesTest extends AmqpClientTestSupport {
|
|||
server0.start();
|
||||
server1.start();
|
||||
|
||||
server0.createQueue(new QueueConfiguration(customNotificationQueue).setRoutingType(RoutingType.ANYCAST));
|
||||
server0.createQueue(new QueueConfiguration(frameworkNotificationsQueue).setRoutingType(RoutingType.ANYCAST));
|
||||
server1.createQueue(new QueueConfiguration(bridgeNotificationsQueue).setRoutingType(RoutingType.ANYCAST));
|
||||
server1.createQueue(new QueueConfiguration(notificationsQueue));
|
||||
server0.createQueue(QueueConfiguration.of(customNotificationQueue).setRoutingType(RoutingType.ANYCAST));
|
||||
server0.createQueue(QueueConfiguration.of(frameworkNotificationsQueue).setRoutingType(RoutingType.ANYCAST));
|
||||
server1.createQueue(QueueConfiguration.of(bridgeNotificationsQueue).setRoutingType(RoutingType.ANYCAST));
|
||||
server1.createQueue(QueueConfiguration.of(notificationsQueue));
|
||||
|
||||
server0.deployBridge(new BridgeConfiguration().setName("notifications-bridge").setQueueName(frameworkNotificationsQueue.toString()).setForwardingAddress(bridgeNotificationsQueue.toString()).setConfirmationWindowSize(10).setStaticConnectors(Arrays.asList("notification-broker")).setTransformerConfiguration(new TransformerConfiguration(BridgeApplicationPropertiesTransformer.class.getName())));
|
||||
}
|
||||
|
|
|
@ -136,14 +136,14 @@ public class AmqpBridgeClusterRedistributionTest extends AmqpClientTestSupport {
|
|||
server1.start();
|
||||
server2.start();
|
||||
|
||||
server0.createQueue(new QueueConfiguration(customNotificationQueue).setRoutingType(RoutingType.ANYCAST));
|
||||
server0.createQueue(new QueueConfiguration(frameworkNotificationsQueue).setRoutingType(RoutingType.ANYCAST));
|
||||
server0.createQueue(QueueConfiguration.of(customNotificationQueue).setRoutingType(RoutingType.ANYCAST));
|
||||
server0.createQueue(QueueConfiguration.of(frameworkNotificationsQueue).setRoutingType(RoutingType.ANYCAST));
|
||||
|
||||
server1.createQueue(new QueueConfiguration(bridgeNotificationsQueue).setRoutingType(RoutingType.ANYCAST));
|
||||
server1.createQueue(new QueueConfiguration(notificationsQueue));
|
||||
server1.createQueue(QueueConfiguration.of(bridgeNotificationsQueue).setRoutingType(RoutingType.ANYCAST));
|
||||
server1.createQueue(QueueConfiguration.of(notificationsQueue));
|
||||
|
||||
server2.createQueue(new QueueConfiguration(bridgeNotificationsQueue).setRoutingType(RoutingType.ANYCAST));
|
||||
server2.createQueue(new QueueConfiguration(notificationsQueue));
|
||||
server2.createQueue(QueueConfiguration.of(bridgeNotificationsQueue).setRoutingType(RoutingType.ANYCAST));
|
||||
server2.createQueue(QueueConfiguration.of(notificationsQueue));
|
||||
|
||||
server0.deployBridge(new BridgeConfiguration().setName("notifications-bridge").setQueueName(frameworkNotificationsQueue.toString()).setForwardingAddress(bridgeNotificationsQueue.toString()).setConfirmationWindowSize(10).setStaticConnectors(Arrays.asList("notification-broker")));
|
||||
}
|
||||
|
|
|
@ -176,20 +176,20 @@ public class AmqpClientTestSupport extends AmqpTestSupport {
|
|||
protected void createAddressAndQueues(ActiveMQServer server) throws Exception {
|
||||
// Default Queue
|
||||
server.addAddressInfo(new AddressInfo(SimpleString.of(getQueueName()), RoutingType.ANYCAST));
|
||||
server.createQueue(new QueueConfiguration(getQueueName()).setRoutingType(RoutingType.ANYCAST));
|
||||
server.createQueue(QueueConfiguration.of(getQueueName()).setRoutingType(RoutingType.ANYCAST));
|
||||
|
||||
// Default DLQ
|
||||
server.addAddressInfo(new AddressInfo(SimpleString.of(getDeadLetterAddress()), RoutingType.ANYCAST));
|
||||
server.createQueue(new QueueConfiguration(getDeadLetterAddress()).setRoutingType(RoutingType.ANYCAST));
|
||||
server.createQueue(QueueConfiguration.of(getDeadLetterAddress()).setRoutingType(RoutingType.ANYCAST));
|
||||
|
||||
// Default Topic
|
||||
server.addAddressInfo(new AddressInfo(SimpleString.of(getTopicName()), RoutingType.MULTICAST));
|
||||
server.createQueue(new QueueConfiguration(getTopicName()));
|
||||
server.createQueue(QueueConfiguration.of(getTopicName()));
|
||||
|
||||
// Additional Test Queues
|
||||
for (int i = 0; i < getPrecreatedQueueSize(); ++i) {
|
||||
server.addAddressInfo(new AddressInfo(SimpleString.of(getQueueName(i)), RoutingType.ANYCAST));
|
||||
server.createQueue(new QueueConfiguration(getQueueName(i)).setRoutingType(RoutingType.ANYCAST));
|
||||
server.createQueue(QueueConfiguration.of(getQueueName(i)).setRoutingType(RoutingType.ANYCAST));
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -571,7 +571,7 @@ public class AmqpExpiredMessageTest extends AmqpClientTestSupport {
|
|||
@Timeout(60)
|
||||
public void testExpirationAfterDivert() throws Throwable {
|
||||
final String FORWARDING_ADDRESS = RandomUtil.randomString();
|
||||
server.createQueue(new QueueConfiguration(FORWARDING_ADDRESS).setRoutingType(RoutingType.ANYCAST));
|
||||
server.createQueue(QueueConfiguration.of(FORWARDING_ADDRESS).setRoutingType(RoutingType.ANYCAST));
|
||||
server.deployDivert(new DivertConfiguration()
|
||||
.setName(RandomUtil.randomString())
|
||||
.setAddress(getQueueName())
|
||||
|
|
|
@ -114,7 +114,7 @@ public class AmqpFullyQualifiedNameTest extends JMSClientTestSupport {
|
|||
if (autocreate) {
|
||||
server.getAddressSettingsRepository().addMatch("#", new AddressSettings().setAutoCreateAddresses(true).setAutoCreateQueues(true));
|
||||
} else {
|
||||
server.createQueue(new QueueConfiguration(anycastQ1).setAddress(multicastAddress).setDurable(false));
|
||||
server.createQueue(QueueConfiguration.of(anycastQ1).setAddress(multicastAddress).setDurable(false));
|
||||
}
|
||||
|
||||
try (Connection connection = createConnection(false)) {
|
||||
|
@ -150,8 +150,8 @@ public class AmqpFullyQualifiedNameTest extends JMSClientTestSupport {
|
|||
String queue1 = "q1";
|
||||
String queue2 = "q2";
|
||||
|
||||
server.createQueue(new QueueConfiguration(queue1).setAddress(address1).setRoutingType(RoutingType.ANYCAST));
|
||||
server.createQueue(new QueueConfiguration(queue2).setAddress(address2).setRoutingType(RoutingType.ANYCAST));
|
||||
server.createQueue(QueueConfiguration.of(queue1).setAddress(address1).setRoutingType(RoutingType.ANYCAST));
|
||||
server.createQueue(QueueConfiguration.of(queue2).setAddress(address2).setRoutingType(RoutingType.ANYCAST));
|
||||
|
||||
Exception e = null;
|
||||
|
||||
|
@ -182,8 +182,8 @@ public class AmqpFullyQualifiedNameTest extends JMSClientTestSupport {
|
|||
String queue1 = "q1";
|
||||
String queue2 = "q2";
|
||||
|
||||
server.createQueue(new QueueConfiguration(queue1).setAddress(address1));
|
||||
server.createQueue(new QueueConfiguration(queue2).setAddress(address2));
|
||||
server.createQueue(QueueConfiguration.of(queue1).setAddress(address1));
|
||||
server.createQueue(QueueConfiguration.of(queue2).setAddress(address2));
|
||||
|
||||
Exception e = null;
|
||||
|
||||
|
@ -212,7 +212,7 @@ public class AmqpFullyQualifiedNameTest extends JMSClientTestSupport {
|
|||
public void testTopic() throws Exception {
|
||||
|
||||
SimpleString queueName = SimpleString.of("someAddress");
|
||||
server.createQueue(new QueueConfiguration(queueName).setAddress(multicastAddress).setDurable(false));
|
||||
server.createQueue(QueueConfiguration.of(queueName).setAddress(multicastAddress).setDurable(false));
|
||||
Connection connection = createConnection(false);
|
||||
|
||||
try {
|
||||
|
@ -260,8 +260,8 @@ public class AmqpFullyQualifiedNameTest extends JMSClientTestSupport {
|
|||
|
||||
SimpleString queueName1 = SimpleString.of("sub.queue1");
|
||||
SimpleString queueName2 = SimpleString.of("sub.queue2");
|
||||
server.createQueue(new QueueConfiguration(queueName1).setAddress(multicastAddress).setDurable(false));
|
||||
server.createQueue(new QueueConfiguration(queueName2).setAddress(multicastAddress).setDurable(false));
|
||||
server.createQueue(QueueConfiguration.of(queueName1).setAddress(multicastAddress).setDurable(false));
|
||||
server.createQueue(QueueConfiguration.of(queueName2).setAddress(multicastAddress).setDurable(false));
|
||||
Connection connection = createConnection(false);
|
||||
|
||||
try {
|
||||
|
@ -294,9 +294,9 @@ public class AmqpFullyQualifiedNameTest extends JMSClientTestSupport {
|
|||
server.getAddressSettingsRepository().addMatch("#", new AddressSettings().setAutoCreateQueues(false).setAutoCreateAddresses(false));
|
||||
|
||||
server.addAddressInfo(new AddressInfo(anycastAddress).addRoutingType(RoutingType.ANYCAST).setAutoCreated(false));
|
||||
server.createQueue(new QueueConfiguration(anycastQ1).setAddress(anycastAddress).setRoutingType(RoutingType.ANYCAST).setDurable(true));
|
||||
server.createQueue(new QueueConfiguration(anycastQ2).setAddress(anycastAddress).setRoutingType(RoutingType.ANYCAST).setDurable(true));
|
||||
server.createQueue(new QueueConfiguration(anycastQ3).setAddress(anycastAddress).setRoutingType(RoutingType.ANYCAST).setDurable(true));
|
||||
server.createQueue(QueueConfiguration.of(anycastQ1).setAddress(anycastAddress).setRoutingType(RoutingType.ANYCAST).setDurable(true));
|
||||
server.createQueue(QueueConfiguration.of(anycastQ2).setAddress(anycastAddress).setRoutingType(RoutingType.ANYCAST).setDurable(true));
|
||||
server.createQueue(QueueConfiguration.of(anycastQ3).setAddress(anycastAddress).setRoutingType(RoutingType.ANYCAST).setDurable(true));
|
||||
|
||||
Connection connection = createConnection();
|
||||
try {
|
||||
|
@ -374,7 +374,7 @@ public class AmqpFullyQualifiedNameTest extends JMSClientTestSupport {
|
|||
*/
|
||||
@Test
|
||||
public void testQueueSpecial() throws Exception {
|
||||
server.createQueue(new QueueConfiguration(anycastQ1).setAddress(anycastAddress).setRoutingType(RoutingType.ANYCAST));
|
||||
server.createQueue(QueueConfiguration.of(anycastQ1).setAddress(anycastAddress).setRoutingType(RoutingType.ANYCAST));
|
||||
|
||||
Connection connection = createConnection();
|
||||
Exception expectedException = null;
|
||||
|
|
|
@ -91,7 +91,7 @@ public class AmqpIngressTimestampTest extends AmqpClientTestSupport {
|
|||
|
||||
private void internalTestIngressTimestamp(Protocol protocol) throws Exception {
|
||||
final String QUEUE_NAME = RandomUtil.randomString();
|
||||
server.createQueue(new QueueConfiguration(QUEUE_NAME).setRoutingType(RoutingType.ANYCAST));
|
||||
server.createQueue(QueueConfiguration.of(QUEUE_NAME).setRoutingType(RoutingType.ANYCAST));
|
||||
server.getAddressSettingsRepository().addMatch(QUEUE_NAME, new AddressSettings().setEnableIngressTimestamp(true));
|
||||
long beforeSend = System.currentTimeMillis();
|
||||
if (protocol == Protocol.CORE) {
|
||||
|
|
|
@ -556,7 +556,7 @@ public class AmqpLargeMessageTest extends AmqpClientTestSupport {
|
|||
|
||||
private void testLargeHeaderTX(boolean largeBody) throws Exception {
|
||||
String testQueueName = RandomUtil.randomString();
|
||||
server.createQueue(new QueueConfiguration(testQueueName).setRoutingType(RoutingType.ANYCAST));
|
||||
server.createQueue(QueueConfiguration.of(testQueueName).setRoutingType(RoutingType.ANYCAST));
|
||||
ConnectionFactory cf = CFUtil.createConnectionFactory("AMQP", "tcp://localhost:5672");
|
||||
|
||||
String largeString;
|
||||
|
|
|
@ -71,7 +71,7 @@ public class AmqpMessageDivertsTest extends AmqpClientTestSupport implements Tra
|
|||
public void runQueueReceiverReadMessageWithDivert(String routingType) throws Exception {
|
||||
final String forwardingAddress = getQueueName() + "Divert";
|
||||
final SimpleString simpleForwardingAddress = SimpleString.of(forwardingAddress);
|
||||
server.createQueue(new QueueConfiguration(simpleForwardingAddress).setRoutingType(RoutingType.ANYCAST));
|
||||
server.createQueue(QueueConfiguration.of(simpleForwardingAddress).setRoutingType(RoutingType.ANYCAST));
|
||||
server.getActiveMQServerControl().createDivert("name", "routingName", getQueueName(), forwardingAddress, true, null, null, routingType);
|
||||
|
||||
sendMessages(getQueueName(), 1);
|
||||
|
@ -108,7 +108,7 @@ public class AmqpMessageDivertsTest extends AmqpClientTestSupport implements Tra
|
|||
divertCount.set(0);
|
||||
final String forwardingAddress = getQueueName() + "Divert";
|
||||
final SimpleString simpleForwardingAddress = SimpleString.of(forwardingAddress);
|
||||
server.createQueue(new QueueConfiguration(simpleForwardingAddress).setRoutingType(RoutingType.ANYCAST));
|
||||
server.createQueue(QueueConfiguration.of(simpleForwardingAddress).setRoutingType(RoutingType.ANYCAST));
|
||||
server.getActiveMQServerControl().createDivert("name", "routingName", getQueueName(),
|
||||
forwardingAddress, true, null, AmqpMessageDivertsTest.class.getName(),
|
||||
ComponentConfigurationRoutingType.ANYCAST.toString());
|
||||
|
|
|
@ -65,9 +65,9 @@ public class AmqpMessageRoutingTest extends JMSClientTestSupport {
|
|||
|
||||
ActiveMQServerControl serverControl = server.getActiveMQServerControl();
|
||||
serverControl.createAddress(addressA, RoutingType.ANYCAST.toString() + "," + RoutingType.MULTICAST.toString());
|
||||
serverControl.createQueue(new QueueConfiguration(queueA).setAddress(addressA).setRoutingType(RoutingType.ANYCAST).toJSON());
|
||||
serverControl.createQueue(new QueueConfiguration(queueB).setAddress(addressA).setRoutingType(RoutingType.ANYCAST).toJSON());
|
||||
serverControl.createQueue(new QueueConfiguration(queueC).setAddress(addressA).setRoutingType(RoutingType.MULTICAST).toJSON());
|
||||
serverControl.createQueue(QueueConfiguration.of(queueA).setAddress(addressA).setRoutingType(RoutingType.ANYCAST).toJSON());
|
||||
serverControl.createQueue(QueueConfiguration.of(queueB).setAddress(addressA).setRoutingType(RoutingType.ANYCAST).toJSON());
|
||||
serverControl.createQueue(QueueConfiguration.of(queueC).setAddress(addressA).setRoutingType(RoutingType.MULTICAST).toJSON());
|
||||
|
||||
sendMessages(ANYCAST_PREFIX + addressA, 1);
|
||||
|
||||
|
@ -85,9 +85,9 @@ public class AmqpMessageRoutingTest extends JMSClientTestSupport {
|
|||
|
||||
ActiveMQServerControl serverControl = server.getActiveMQServerControl();
|
||||
serverControl.createAddress(addressA, RoutingType.ANYCAST.toString() + "," + RoutingType.MULTICAST.toString());
|
||||
serverControl.createQueue(new QueueConfiguration(queueA).setAddress(addressA).setRoutingType(RoutingType.ANYCAST).toJSON());
|
||||
serverControl.createQueue(new QueueConfiguration(queueB).setAddress(addressA).setRoutingType(RoutingType.ANYCAST).toJSON());
|
||||
serverControl.createQueue(new QueueConfiguration(queueC).setAddress(addressA).setRoutingType(RoutingType.MULTICAST).toJSON());
|
||||
serverControl.createQueue(QueueConfiguration.of(queueA).setAddress(addressA).setRoutingType(RoutingType.ANYCAST).toJSON());
|
||||
serverControl.createQueue(QueueConfiguration.of(queueB).setAddress(addressA).setRoutingType(RoutingType.ANYCAST).toJSON());
|
||||
serverControl.createQueue(QueueConfiguration.of(queueC).setAddress(addressA).setRoutingType(RoutingType.MULTICAST).toJSON());
|
||||
|
||||
sendMessages(addressA, 1, RoutingType.ANYCAST);
|
||||
|
||||
|
@ -105,9 +105,9 @@ public class AmqpMessageRoutingTest extends JMSClientTestSupport {
|
|||
|
||||
ActiveMQServerControl serverControl = server.getActiveMQServerControl();
|
||||
serverControl.createAddress(addressA, RoutingType.ANYCAST.toString() + "," + RoutingType.MULTICAST.toString());
|
||||
serverControl.createQueue(new QueueConfiguration(queueA).setAddress(addressA).setRoutingType(RoutingType.ANYCAST).toJSON());
|
||||
serverControl.createQueue(new QueueConfiguration(queueB).setAddress(addressA).setRoutingType(RoutingType.MULTICAST).toJSON());
|
||||
serverControl.createQueue(new QueueConfiguration(queueC).setAddress(addressA).setRoutingType(RoutingType.MULTICAST).toJSON());
|
||||
serverControl.createQueue(QueueConfiguration.of(queueA).setAddress(addressA).setRoutingType(RoutingType.ANYCAST).toJSON());
|
||||
serverControl.createQueue(QueueConfiguration.of(queueB).setAddress(addressA).setRoutingType(RoutingType.MULTICAST).toJSON());
|
||||
serverControl.createQueue(QueueConfiguration.of(queueC).setAddress(addressA).setRoutingType(RoutingType.MULTICAST).toJSON());
|
||||
|
||||
sendMessages(MULTICAST_PREFIX + addressA, 1);
|
||||
|
||||
|
@ -125,9 +125,9 @@ public class AmqpMessageRoutingTest extends JMSClientTestSupport {
|
|||
|
||||
ActiveMQServerControl serverControl = server.getActiveMQServerControl();
|
||||
serverControl.createAddress(addressA, RoutingType.ANYCAST.toString() + "," + RoutingType.MULTICAST.toString());
|
||||
serverControl.createQueue(new QueueConfiguration(queueA).setAddress(addressA).setRoutingType(RoutingType.ANYCAST).toJSON());
|
||||
serverControl.createQueue(new QueueConfiguration(queueB).setAddress(addressA).setRoutingType(RoutingType.MULTICAST).toJSON());
|
||||
serverControl.createQueue(new QueueConfiguration(queueC).setAddress(addressA).setRoutingType(RoutingType.MULTICAST).toJSON());
|
||||
serverControl.createQueue(QueueConfiguration.of(queueA).setAddress(addressA).setRoutingType(RoutingType.ANYCAST).toJSON());
|
||||
serverControl.createQueue(QueueConfiguration.of(queueB).setAddress(addressA).setRoutingType(RoutingType.MULTICAST).toJSON());
|
||||
serverControl.createQueue(QueueConfiguration.of(queueC).setAddress(addressA).setRoutingType(RoutingType.MULTICAST).toJSON());
|
||||
|
||||
sendMessages(addressA, 1, RoutingType.MULTICAST);
|
||||
|
||||
|
@ -155,7 +155,7 @@ public class AmqpMessageRoutingTest extends JMSClientTestSupport {
|
|||
addressInfo.addRoutingType(RoutingType.ANYCAST);
|
||||
|
||||
server.addAddressInfo(addressInfo);
|
||||
server.createQueue(new QueueConfiguration(ssTestAddress).setRoutingType(RoutingType.ANYCAST));
|
||||
server.createQueue(QueueConfiguration.of(ssTestAddress).setRoutingType(RoutingType.ANYCAST));
|
||||
|
||||
Connection connection = createConnection(UUIDGenerator.getInstance().generateStringUUID());
|
||||
|
||||
|
@ -203,7 +203,7 @@ public class AmqpMessageRoutingTest extends JMSClientTestSupport {
|
|||
|
||||
ActiveMQServerControl serverControl = server.getActiveMQServerControl();
|
||||
serverControl.createAddress(addressA, RoutingType.ANYCAST.toString() + "," + RoutingType.MULTICAST.toString());
|
||||
serverControl.createQueue(new QueueConfiguration(addressA).setRoutingType(RoutingType.ANYCAST).toJSON());
|
||||
serverControl.createQueue(QueueConfiguration.of(addressA).setRoutingType(RoutingType.ANYCAST).toJSON());
|
||||
try {
|
||||
Session session = connection.createSession(false, Session.AUTO_ACKNOWLEDGE);
|
||||
|
||||
|
|
|
@ -58,7 +58,7 @@ public class AmqpPurgeOnNoConsumersTest extends AmqpClientTestSupport {
|
|||
SimpleString ssQueue = SimpleString.of(queue);
|
||||
|
||||
server.addAddressInfo(new AddressInfo(ssQueue, RoutingType.ANYCAST));
|
||||
server.createQueue(new QueueConfiguration(ssQueue).setRoutingType(RoutingType.ANYCAST).setMaxConsumers(1).setPurgeOnNoConsumers(true).setAutoCreateAddress(false));
|
||||
server.createQueue(QueueConfiguration.of(ssQueue).setRoutingType(RoutingType.ANYCAST).setMaxConsumers(1).setPurgeOnNoConsumers(true).setAutoCreateAddress(false));
|
||||
|
||||
AmqpClient client = createAmqpClient();
|
||||
connection = addConnection(client.connect());
|
||||
|
@ -114,7 +114,7 @@ public class AmqpPurgeOnNoConsumersTest extends AmqpClientTestSupport {
|
|||
String queue = "purgeQueue";
|
||||
SimpleString ssQueue = SimpleString.of(queue);
|
||||
server.addAddressInfo(new AddressInfo(ssQueue, RoutingType.ANYCAST));
|
||||
server.createQueue(new QueueConfiguration(ssQueue).setRoutingType(RoutingType.ANYCAST).setMaxConsumers(1).setPurgeOnNoConsumers(true).setAutoCreateAddress(false));
|
||||
server.createQueue(QueueConfiguration.of(ssQueue).setRoutingType(RoutingType.ANYCAST).setMaxConsumers(1).setPurgeOnNoConsumers(true).setAutoCreateAddress(false));
|
||||
|
||||
ActiveMQConnectionFactory cf = new ActiveMQConnectionFactory("tcp://localhost:5672");
|
||||
Connection connection = cf.createConnection();
|
||||
|
|
|
@ -1166,7 +1166,7 @@ public class AmqpSendReceiveTest extends AmqpClientTestSupport {
|
|||
String queueName = "TestQueueName";
|
||||
String address = "TestAddress";
|
||||
server.addAddressInfo(new AddressInfo(SimpleString.of(address), RoutingType.ANYCAST));
|
||||
server.createQueue(new QueueConfiguration(SimpleString.of(queueName)).setAddress(SimpleString.of(address)).setRoutingType(RoutingType.ANYCAST));
|
||||
server.createQueue(QueueConfiguration.of(queueName).setAddress(address).setRoutingType(RoutingType.ANYCAST));
|
||||
|
||||
AmqpClient client = createAmqpClient();
|
||||
AmqpConnection connection = addConnection(client.connect());
|
||||
|
|
|
@ -881,7 +881,7 @@ public class AmqpTransactionTest extends AmqpClientTestSupport {
|
|||
public void testSendPersistentTX() throws Exception {
|
||||
int MESSAGE_COUNT = 2000;
|
||||
AtomicInteger errors = new AtomicInteger(0);
|
||||
server.createQueue(new QueueConfiguration("q1").setRoutingType(RoutingType.ANYCAST).setMaxConsumers(1));
|
||||
server.createQueue(QueueConfiguration.of("q1").setRoutingType(RoutingType.ANYCAST).setMaxConsumers(1));
|
||||
ConnectionFactory factory = new JmsConnectionFactory("amqp://localhost:" + AMQP_PORT);
|
||||
Connection sendConnection = factory.createConnection();
|
||||
Connection consumerConnection = factory.createConnection();
|
||||
|
|
|
@ -54,7 +54,7 @@ public class BrokerDefinedAnycastConsumerTest extends AmqpClientTestSupport {
|
|||
@Timeout(60)
|
||||
public void testConsumeFromSingleQueueOnAddressSameName() throws Exception {
|
||||
server.addAddressInfo(new AddressInfo(address, RoutingType.ANYCAST));
|
||||
server.createQueue(new QueueConfiguration(address).setRoutingType(RoutingType.ANYCAST));
|
||||
server.createQueue(QueueConfiguration.of(address).setRoutingType(RoutingType.ANYCAST));
|
||||
|
||||
sendMessages(address.toString(), 1);
|
||||
|
||||
|
@ -76,8 +76,8 @@ public class BrokerDefinedAnycastConsumerTest extends AmqpClientTestSupport {
|
|||
@Timeout(60)
|
||||
public void testConsumeFromSingleQueueOnAddressSameNameMultipleQueues() throws Exception {
|
||||
server.addAddressInfo(new AddressInfo(address, RoutingType.ANYCAST));
|
||||
server.createQueue(new QueueConfiguration(queue1).setAddress(address).setRoutingType(RoutingType.ANYCAST));
|
||||
server.createQueue(new QueueConfiguration(address).setRoutingType(RoutingType.ANYCAST));
|
||||
server.createQueue(QueueConfiguration.of(queue1).setAddress(address).setRoutingType(RoutingType.ANYCAST));
|
||||
server.createQueue(QueueConfiguration.of(address).setRoutingType(RoutingType.ANYCAST));
|
||||
|
||||
sendMessages(address.toString(), 2);
|
||||
|
||||
|
@ -99,7 +99,7 @@ public class BrokerDefinedAnycastConsumerTest extends AmqpClientTestSupport {
|
|||
@Timeout(60)
|
||||
public void testConsumeFromSingleQueueOnAddressDifferentName() throws Exception {
|
||||
server.addAddressInfo(new AddressInfo(address, RoutingType.ANYCAST));
|
||||
server.createQueue(new QueueConfiguration(queue1).setAddress(address).setRoutingType(RoutingType.ANYCAST));
|
||||
server.createQueue(QueueConfiguration.of(queue1).setAddress(address).setRoutingType(RoutingType.ANYCAST));
|
||||
|
||||
sendMessages(address.toString(), 1);
|
||||
|
||||
|
@ -121,8 +121,8 @@ public class BrokerDefinedAnycastConsumerTest extends AmqpClientTestSupport {
|
|||
@Timeout(60)
|
||||
public void testConsumeFromSingleQueueOnAddressDifferentNameMultipleQueues() throws Exception {
|
||||
server.addAddressInfo(new AddressInfo(address, RoutingType.ANYCAST));
|
||||
server.createQueue(new QueueConfiguration(queue1).setAddress(address).setRoutingType(RoutingType.ANYCAST));
|
||||
server.createQueue(new QueueConfiguration(queue2).setAddress(address).setRoutingType(RoutingType.ANYCAST));
|
||||
server.createQueue(QueueConfiguration.of(queue1).setAddress(address).setRoutingType(RoutingType.ANYCAST));
|
||||
server.createQueue(QueueConfiguration.of(queue2).setAddress(address).setRoutingType(RoutingType.ANYCAST));
|
||||
|
||||
sendMessages(address.toString(), 1);
|
||||
|
||||
|
@ -144,7 +144,7 @@ public class BrokerDefinedAnycastConsumerTest extends AmqpClientTestSupport {
|
|||
@Timeout(60)
|
||||
public void testConsumeFromSingleQualifiedQueueOnAddressSameName() throws Exception {
|
||||
server.addAddressInfo(new AddressInfo(address, RoutingType.ANYCAST));
|
||||
server.createQueue(new QueueConfiguration(queue1).setAddress(address).setRoutingType(RoutingType.ANYCAST));
|
||||
server.createQueue(QueueConfiguration.of(queue1).setAddress(address).setRoutingType(RoutingType.ANYCAST));
|
||||
|
||||
sendMessages(address.toString(), 1);
|
||||
|
||||
|
@ -230,7 +230,7 @@ public class BrokerDefinedAnycastConsumerTest extends AmqpClientTestSupport {
|
|||
addressInfo.getRoutingTypes().add(RoutingType.ANYCAST);
|
||||
addressInfo.getRoutingTypes().add(RoutingType.MULTICAST);
|
||||
server.addAddressInfo(addressInfo);
|
||||
server.createQueue(new QueueConfiguration(address));
|
||||
server.createQueue(QueueConfiguration.of(address));
|
||||
|
||||
AmqpClient client = createAmqpClient();
|
||||
AmqpConnection connection = addConnection(client.connect());
|
||||
|
|
|
@ -58,7 +58,7 @@ public class BrokerDefinedMulticastConsumerTest extends AmqpClientTestSupport {
|
|||
@Timeout(60)
|
||||
public void testConsumeFromSingleQueueOnAddressSameName() throws Exception {
|
||||
server.addAddressInfo(new AddressInfo(address, RoutingType.MULTICAST));
|
||||
server.createQueue(new QueueConfiguration(address));
|
||||
server.createQueue(QueueConfiguration.of(address));
|
||||
|
||||
sendMessages(address.toString(), 1);
|
||||
|
||||
|
@ -80,7 +80,7 @@ public class BrokerDefinedMulticastConsumerTest extends AmqpClientTestSupport {
|
|||
@Timeout(60)
|
||||
public void testConsumeWhenOnlyAnycast() throws Exception {
|
||||
server.addAddressInfo(new AddressInfo(address, RoutingType.ANYCAST));
|
||||
server.createQueue(new QueueConfiguration(address).setAddress(address).setRoutingType(RoutingType.ANYCAST));
|
||||
server.createQueue(QueueConfiguration.of(address).setAddress(address).setRoutingType(RoutingType.ANYCAST));
|
||||
|
||||
sendMessages(address.toString(), 1);
|
||||
|
||||
|
@ -106,7 +106,7 @@ public class BrokerDefinedMulticastConsumerTest extends AmqpClientTestSupport {
|
|||
addressInfo.getRoutingTypes().add(RoutingType.MULTICAST);
|
||||
addressInfo.getRoutingTypes().add(RoutingType.ANYCAST);
|
||||
server.addAddressInfo(addressInfo);
|
||||
server.createQueue(new QueueConfiguration(address));
|
||||
server.createQueue(QueueConfiguration.of(address));
|
||||
|
||||
AmqpClient client = createAmqpClient();
|
||||
AmqpConnection connection = addConnection(client.connect());
|
||||
|
|
|
@ -84,7 +84,7 @@ public class ClientDefinedMultiConsumerTest extends AmqpClientTestSupport {
|
|||
AddressInfo addressInfo = new AddressInfo(address);
|
||||
addressInfo.getRoutingTypes().add(RoutingType.MULTICAST);
|
||||
server.addAddressInfo(addressInfo);
|
||||
server.createQueue(new QueueConfiguration("myClientId.mySub:shared-volatile").setAddress(address).setAutoCreateAddress(false));
|
||||
server.createQueue(QueueConfiguration.of("myClientId.mySub:shared-volatile").setAddress(address).setAutoCreateAddress(false));
|
||||
AmqpClient client = createAmqpClient();
|
||||
|
||||
AmqpConnection connection = addConnection(client.connect("myClientId"));
|
||||
|
|
|
@ -57,24 +57,24 @@ public class DLQAfterExpiredMessageTest extends AmqpClientTestSupport {
|
|||
protected void createAddressAndQueues(ActiveMQServer server) throws Exception {
|
||||
// Default Queue
|
||||
server.addAddressInfo(new AddressInfo(SimpleString.of(getQueueName()), RoutingType.ANYCAST));
|
||||
server.createQueue(new QueueConfiguration(getQueueName()).setRoutingType(RoutingType.ANYCAST));
|
||||
server.createQueue(QueueConfiguration.of(getQueueName()).setRoutingType(RoutingType.ANYCAST));
|
||||
|
||||
// Default DLQ
|
||||
server.addAddressInfo(new AddressInfo(SimpleString.of(getDeadLetterAddress()), RoutingType.ANYCAST));
|
||||
server.createQueue(new QueueConfiguration(getDeadLetterAddress()).setRoutingType(RoutingType.ANYCAST));
|
||||
server.createQueue(QueueConfiguration.of(getDeadLetterAddress()).setRoutingType(RoutingType.ANYCAST));
|
||||
|
||||
// Expiry
|
||||
server.addAddressInfo(new AddressInfo(SimpleString.of(getExpiryQueue()), RoutingType.ANYCAST));
|
||||
server.createQueue(new QueueConfiguration(getExpiryQueue()).setRoutingType(RoutingType.ANYCAST));
|
||||
server.createQueue(QueueConfiguration.of(getExpiryQueue()).setRoutingType(RoutingType.ANYCAST));
|
||||
|
||||
// Default Topic
|
||||
server.addAddressInfo(new AddressInfo(SimpleString.of(getTopicName()), RoutingType.MULTICAST));
|
||||
server.createQueue(new QueueConfiguration(getTopicName()));
|
||||
server.createQueue(QueueConfiguration.of(getTopicName()));
|
||||
|
||||
// Additional Test Queues
|
||||
for (int i = 0; i < getPrecreatedQueueSize(); ++i) {
|
||||
server.addAddressInfo(new AddressInfo(SimpleString.of(getQueueName(i)), RoutingType.ANYCAST));
|
||||
server.createQueue(new QueueConfiguration(getQueueName(i)).setRoutingType(RoutingType.ANYCAST));
|
||||
server.createQueue(QueueConfiguration.of(getQueueName(i)).setRoutingType(RoutingType.ANYCAST));
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -72,7 +72,7 @@ public class ExtremeCancelsTest extends JMSClientTestSupport {
|
|||
@Timeout(120)
|
||||
public void testLotsOfCloseOpenConsumer() throws Exception {
|
||||
|
||||
server.createQueue(new QueueConfiguration(anycastAddress).setRoutingType(RoutingType.ANYCAST));
|
||||
server.createQueue(QueueConfiguration.of(anycastAddress).setRoutingType(RoutingType.ANYCAST));
|
||||
|
||||
AtomicInteger errors = new AtomicInteger(0);
|
||||
AtomicBoolean runnning = new AtomicBoolean(true);
|
||||
|
|
|
@ -54,9 +54,9 @@ public class JMSTransactedRedeliveryBugTest extends JMSClientTestSupport {
|
|||
protected void createAddressAndQueues(ActiveMQServer server) throws Exception {
|
||||
super.createAddressAndQueues(server);
|
||||
server.addAddressInfo(new AddressInfo(INITIAL_QUEUE_SS, RoutingType.ANYCAST));
|
||||
server.createQueue(new QueueConfiguration(INITIAL_QUEUE_SS).setRoutingType(RoutingType.ANYCAST));
|
||||
server.createQueue(QueueConfiguration.of(INITIAL_QUEUE_SS).setRoutingType(RoutingType.ANYCAST));
|
||||
server.addAddressInfo(new AddressInfo(FINAL_QUEUE_SS, RoutingType.ANYCAST));
|
||||
server.createQueue(new QueueConfiguration(FINAL_QUEUE_SS).setRoutingType(RoutingType.ANYCAST));
|
||||
server.createQueue(QueueConfiguration.of(FINAL_QUEUE_SS).setRoutingType(RoutingType.ANYCAST));
|
||||
}
|
||||
|
||||
@Override
|
||||
|
|
|
@ -92,7 +92,7 @@ public class AMQPBridgeDisconnectTest extends AmqpClientTestSupport {
|
|||
ActiveMQServer server = super.createServer(port, start);
|
||||
server.getConfiguration().setPersistenceEnabled(false);
|
||||
server.getConfiguration().addAddressConfiguration((new CoreAddressConfiguration()).setName(DESTINATION_NAME).addRoutingType(RoutingType.ANYCAST));
|
||||
server.getConfiguration().addQueueConfiguration((new QueueConfiguration(DESTINATION_NAME)).setAddress(DESTINATION_NAME).setRoutingType(RoutingType.ANYCAST).setDurable(true));
|
||||
server.getConfiguration().addQueueConfiguration((QueueConfiguration.of(DESTINATION_NAME)).setAddress(DESTINATION_NAME).setRoutingType(RoutingType.ANYCAST).setDurable(true));
|
||||
return server;
|
||||
}
|
||||
|
||||
|
|
|
@ -90,7 +90,7 @@ public class AMQPBridgeTest extends AmqpClientTestSupport {
|
|||
server.setIdentity("targetServer");
|
||||
server.start();
|
||||
server.addAddressInfo(new AddressInfo(SimpleString.of(queueName), RoutingType.ANYCAST));
|
||||
server.createQueue(new QueueConfiguration(queueName).setRoutingType(RoutingType.ANYCAST));
|
||||
server.createQueue(QueueConfiguration.of(queueName).setRoutingType(RoutingType.ANYCAST));
|
||||
|
||||
server_2 = createServer(AMQP_PORT_2, false);
|
||||
|
||||
|
@ -99,7 +99,7 @@ public class AMQPBridgeTest extends AmqpClientTestSupport {
|
|||
server_2.getConfiguration().addAMQPConnection(amqpConnection);
|
||||
if (!deferCreation) {
|
||||
server_2.getConfiguration().addAddressConfiguration(new CoreAddressConfiguration().setName(queueName).addRoutingType(RoutingType.ANYCAST));
|
||||
server_2.getConfiguration().addQueueConfiguration(new QueueConfiguration(queueName).setRoutingType(RoutingType.ANYCAST));
|
||||
server_2.getConfiguration().addQueueConfiguration(QueueConfiguration.of(queueName).setRoutingType(RoutingType.ANYCAST));
|
||||
}
|
||||
server_2.setIdentity("serverWithBridge");
|
||||
|
||||
|
@ -108,7 +108,7 @@ public class AMQPBridgeTest extends AmqpClientTestSupport {
|
|||
|
||||
if (deferCreation) {
|
||||
server_2.addAddressInfo(new AddressInfo(queueName).addRoutingType(RoutingType.ANYCAST));
|
||||
server_2.createQueue(new QueueConfiguration(queueName).setRoutingType(RoutingType.ANYCAST));
|
||||
server_2.createQueue(QueueConfiguration.of(queueName).setRoutingType(RoutingType.ANYCAST));
|
||||
}
|
||||
|
||||
if (restartBC) {
|
||||
|
@ -180,7 +180,7 @@ public class AMQPBridgeTest extends AmqpClientTestSupport {
|
|||
server.start();
|
||||
|
||||
server.addAddressInfo(new AddressInfo(SimpleString.of("TEST"), RoutingType.ANYCAST));
|
||||
server.createQueue(new QueueConfiguration("TEST").setRoutingType(RoutingType.ANYCAST));
|
||||
server.createQueue(QueueConfiguration.of("TEST").setRoutingType(RoutingType.ANYCAST));
|
||||
|
||||
server_2 = createServer(AMQP_PORT_2, false);
|
||||
|
||||
|
@ -194,7 +194,7 @@ public class AMQPBridgeTest extends AmqpClientTestSupport {
|
|||
amqpConnection.addElement(new AMQPBrokerConnectionElement().setMatchAddress("TEST").setType(AMQPBrokerConnectionAddressType.RECEIVER));
|
||||
server_2.getConfiguration().addAMQPConnection(amqpConnection);
|
||||
server_2.getConfiguration().addAddressConfiguration(new CoreAddressConfiguration().setName("TEST").addRoutingType(RoutingType.ANYCAST));
|
||||
server_2.getConfiguration().addQueueConfiguration(new QueueConfiguration("TEST").setRoutingType(RoutingType.ANYCAST));
|
||||
server_2.getConfiguration().addQueueConfiguration(QueueConfiguration.of("TEST").setRoutingType(RoutingType.ANYCAST));
|
||||
server_2.setIdentity("serverWithBridge");
|
||||
|
||||
server_2.start();
|
||||
|
|
|
@ -162,7 +162,7 @@ public class AMQPClusterReplicaTest extends AmqpClientTestSupport {
|
|||
private void configureAddressAndQueue(ActiveMQServer node) throws Exception {
|
||||
node.addAddressInfo(new AddressInfo("test").setAutoCreated(false));
|
||||
node.getAddressSettingsRepository().addMatch("test", new AddressSettings().setRedistributionDelay(0));
|
||||
node.createQueue(new QueueConfiguration("test").setAddress("test").setRoutingType(RoutingType.ANYCAST).setDurable(true));
|
||||
node.createQueue(QueueConfiguration.of("test").setAddress("test").setRoutingType(RoutingType.ANYCAST).setDurable(true));
|
||||
}
|
||||
|
||||
@Override
|
||||
|
|
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in New Issue