ARTEMIS-789 Fix various failing tests due to addressing changes
This commit is contained in:
parent
796550d16b
commit
0861be14c1
|
@ -16,7 +16,6 @@
|
|||
*/
|
||||
package org.apache.activemq.artemis.cli.commands;
|
||||
|
||||
import io.airlift.airline.Option;
|
||||
import org.apache.activemq.artemis.api.core.client.ActiveMQClient;
|
||||
import org.apache.activemq.artemis.api.core.client.ClientMessage;
|
||||
import org.apache.activemq.artemis.api.core.client.ClientRequestor;
|
||||
|
|
|
@ -197,11 +197,11 @@ public class Create extends InputAbstract {
|
|||
@Option(name = "--no-web", description = "This will remove the web server definition from bootstrap.xml")
|
||||
boolean noWeb;
|
||||
|
||||
@Option(name = "--queues", description = "comma separated list of jms queues.")
|
||||
@Option(name = "--queues", description = "comma separated list of queues.")
|
||||
String queues;
|
||||
|
||||
@Option(name = "--topics", description = "comma separated list of jms topics ")
|
||||
String topics;
|
||||
@Option(name = "--addresses", description = "comma separated list of addresses ")
|
||||
String addresses;
|
||||
|
||||
@Option(name = "--aio", description = "Force aio journal on the configuration regardless of the library being available or not.")
|
||||
boolean forceLibaio;
|
||||
|
@ -632,7 +632,7 @@ public class Create extends InputAbstract {
|
|||
filters.put("${cluster-password}", "");
|
||||
}
|
||||
|
||||
applyJMSObjects(filters);
|
||||
applyAddressesAndQueues(filters);
|
||||
|
||||
if (home != null) {
|
||||
filters.put("${home}", path(home, false));
|
||||
|
@ -784,12 +784,33 @@ public class Create extends InputAbstract {
|
|||
for (String str : getQueueList()) {
|
||||
printWriter.println(" <queue name=\"" + str + "\"/>");
|
||||
}
|
||||
for (String str : getTopicList()) {
|
||||
for (String str : getAddressList()) {
|
||||
printWriter.println(" <topic name=\"" + str + "\"/>");
|
||||
}
|
||||
filters.put("${jms-list.settings}", writer.toString());
|
||||
}
|
||||
|
||||
/**
|
||||
* It will create the address and queue configurations
|
||||
*/
|
||||
private void applyAddressesAndQueues(HashMap<String, String> filters) {
|
||||
StringWriter writer = new StringWriter();
|
||||
PrintWriter printWriter = new PrintWriter(writer);
|
||||
printWriter.println();
|
||||
|
||||
for (String str : getQueueList()) {
|
||||
printWriter.println(" <address name=\"" + str + "\" type=\"anycast\">");
|
||||
printWriter.println(" <queues>");
|
||||
printWriter.println(" <queue name=\"" + str + "\" />");
|
||||
printWriter.println(" </queues>");
|
||||
printWriter.println(" </address>");
|
||||
}
|
||||
for (String str : getAddressList()) {
|
||||
printWriter.println(" <address name=\"" + str + "\" type=\"multicast\"/>");
|
||||
}
|
||||
filters.put("${address-queue.settings}", writer.toString());
|
||||
}
|
||||
|
||||
private void performAutoTune(HashMap<String, String> filters, boolean aio, File dataFolder) {
|
||||
if (noAutoTune) {
|
||||
filters.put("${journal-buffer.settings}", "");
|
||||
|
@ -862,11 +883,11 @@ public class Create extends InputAbstract {
|
|||
}
|
||||
}
|
||||
|
||||
private String[] getTopicList() {
|
||||
if (topics == null) {
|
||||
private String[] getAddressList() {
|
||||
if (addresses == null) {
|
||||
return new String[0];
|
||||
} else {
|
||||
return topics.split(",");
|
||||
return addresses.split(",");
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -23,7 +23,6 @@ import org.apache.activemq.artemis.api.core.client.ClientMessage;
|
|||
import org.apache.activemq.artemis.api.core.management.ManagementHelper;
|
||||
import org.apache.activemq.artemis.cli.commands.AbstractAction;
|
||||
import org.apache.activemq.artemis.cli.commands.ActionContext;
|
||||
import org.apache.activemq.artemis.core.server.impl.AddressInfo;
|
||||
|
||||
@Command(name = "create", description = "create an address")
|
||||
public class CreateAddress extends AbstractAction {
|
||||
|
|
|
@ -46,8 +46,7 @@ public class ShowAddress extends AbstractAction {
|
|||
public void setUpInvocation(ClientMessage message) throws Exception {
|
||||
if (bindings) {
|
||||
ManagementHelper.putOperationInvocation(message, "broker", "listBindingsForAddress", getName());
|
||||
}
|
||||
else {
|
||||
} else {
|
||||
ManagementHelper.putOperationInvocation(message, "broker", "getAddressInfo", getName());
|
||||
}
|
||||
}
|
||||
|
|
|
@ -74,6 +74,8 @@ ${cluster-security.settings}${cluster.settings}${replicated.settings}${shared-st
|
|||
<permission type="deleteNonDurableQueue" roles="${role}"/>
|
||||
<permission type="createDurableQueue" roles="${role}"/>
|
||||
<permission type="deleteDurableQueue" roles="${role}"/>
|
||||
<permission type="createAddress" roles="${role}"/>
|
||||
<permission type="deleteAddress" roles="${role}"/>
|
||||
<permission type="consume" roles="${role}"/>
|
||||
<permission type="browse" roles="${role}"/>
|
||||
<permission type="send" roles="${role}"/>
|
||||
|
@ -105,7 +107,7 @@ ${cluster-security.settings}${cluster.settings}${replicated.settings}${shared-st
|
|||
<queues>
|
||||
<queue name="ExpiryQueue" />
|
||||
</queues>
|
||||
</address>
|
||||
</address>${address-queue.settings}
|
||||
</addresses>
|
||||
|
||||
</core>
|
||||
|
|
|
@ -533,20 +533,20 @@ public class ArtemisTest {
|
|||
File instanceFolder = temporaryFolder.newFolder(folderName);
|
||||
|
||||
setupAuth(instanceFolder);
|
||||
String queues = "q1,t2";
|
||||
String topics = "t1,t2";
|
||||
String queues = "q1,q2";
|
||||
String addresses = "a1,a2";
|
||||
|
||||
|
||||
// This is usually set when run from the command line via artemis.profile
|
||||
Run.setEmbedded(false);
|
||||
Artemis.main("create", instanceFolder.getAbsolutePath(), "--force", "--silent", "--no-web", "--queues", queues, "--topics", topics, "--no-autotune", "--require-login");
|
||||
Run.setEmbedded(true);
|
||||
Artemis.main("create", instanceFolder.getAbsolutePath(), "--force", "--silent", "--no-web", "--queues", queues, "--addresses", addresses, "--no-autotune", "--require-login");
|
||||
System.setProperty("artemis.instance", instanceFolder.getAbsolutePath());
|
||||
|
||||
// Some exceptions may happen on the initialization, but they should be ok on start the basic core protocol
|
||||
Artemis.internalExecute("run");
|
||||
|
||||
Artemis.main("queue", "create", "--name", "q1", "--address", "q1", "--user", "admin", "--password", "admin");
|
||||
Artemis.main("queue", "create", "--name", "t2", "--address", "t2", "--user", "admin", "--password", "admin");
|
||||
// Artemis.main("queue", "create", "--name", "q1", "--address", "q1", "--user", "admin", "--password", "admin", "--autoCreateAddress");
|
||||
// Artemis.main("queue", "create", "--name", "t2", "--address", "t2", "--user", "admin", "--password", "admin", "--autoCreateAddress");
|
||||
|
||||
try {
|
||||
try (ServerLocator locator = ServerLocatorImpl.newLocator("tcp://localhost:61616");
|
||||
|
@ -556,9 +556,9 @@ public class ArtemisTest {
|
|||
ClientSession.QueueQuery queryResult = coreSession.queueQuery(SimpleString.toSimpleString(str));
|
||||
assertTrue("Couldn't find queue " + str, queryResult.isExists());
|
||||
}
|
||||
for (String str : topics.split(",")) {
|
||||
ClientSession.QueueQuery queryResult = coreSession.queueQuery(SimpleString.toSimpleString(str));
|
||||
assertTrue("Couldn't find topic " + str, queryResult.isExists());
|
||||
for (String str : addresses.split(",")) {
|
||||
ClientSession.AddressQuery queryResult = coreSession.addressQuery(SimpleString.toSimpleString(str));
|
||||
assertTrue("Couldn't find address " + str, queryResult.isExists());
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -162,8 +162,8 @@ public final class ActiveMQDefaultConfiguration {
|
|||
// the name of the address that consumers bind to receive management notifications
|
||||
private static SimpleString DEFAULT_MANAGEMENT_NOTIFICATION_ADDRESS = new SimpleString("activemq.notifications");
|
||||
|
||||
// The default address used for clustering
|
||||
private static String DEFAULT_CLUSTER_ADDRESS = "jms";
|
||||
// The default address used for clustering, empty string means all addresses
|
||||
private static String DEFAULT_CLUSTER_ADDRESS = "";
|
||||
|
||||
// Cluster username. It applies to all cluster configurations.
|
||||
private static String DEFAULT_CLUSTER_USER = "ACTIVEMQ.CLUSTER.ADMIN.USER";
|
||||
|
|
|
@ -293,6 +293,34 @@ public interface ClientSession extends XAResource, AutoCloseable {
|
|||
*/
|
||||
void createQueue(String address, String queueName, String filter, boolean durable) throws ActiveMQException;
|
||||
|
||||
/**
|
||||
* Creates a <em>non-temporary</em> queue.
|
||||
*
|
||||
* @param address the queue will be bound to this address
|
||||
* @param queueName the name of the queue
|
||||
* @param filter only messages which match this filter will be put in the queue
|
||||
* @param durable whether the queue is durable or not
|
||||
* @param autoCreated whether to mark this queue as autoCreated or not
|
||||
* @throws ActiveMQException in an exception occurs while creating the queue
|
||||
*/
|
||||
void createQueue(SimpleString address,
|
||||
SimpleString queueName,
|
||||
SimpleString filter,
|
||||
boolean durable,
|
||||
boolean autoCreated) throws ActiveMQException;
|
||||
|
||||
/**
|
||||
* Creates a <em>non-temporary</em>queue.
|
||||
*
|
||||
* @param address the queue will be bound to this address
|
||||
* @param queueName the name of the queue
|
||||
* @param filter only messages which match this filter will be put in the queue
|
||||
* @param durable whether the queue is durable or not
|
||||
* @param autoCreated whether to mark this queue as autoCreated or not
|
||||
* @throws ActiveMQException in an exception occurs while creating the queue
|
||||
*/
|
||||
void createQueue(String address, String queueName, String filter, boolean durable, boolean autoCreated) throws ActiveMQException;
|
||||
|
||||
/**
|
||||
* Creates a <em>temporary</em> queue.
|
||||
*
|
||||
|
|
|
@ -811,7 +811,8 @@ public interface ActiveMQServerControl {
|
|||
@Parameter(desc = "a comma-separated list of roles allowed to delete non durable queues", name = "deleteNonDurableQueueRoles") String deleteNonDurableQueueRoles,
|
||||
@Parameter(desc = "a comma-separated list of roles allowed to send management messages messages", name = "manage") String manageRoles,
|
||||
@Parameter(desc = "a comma-separated list of roles allowed to browse queues", name = "browse") String browseRoles,
|
||||
@Parameter(desc = "a comma-separated list of roles allowed to create addresses", name = "createAddressRoles") String createAddressRoles) throws Exception;
|
||||
@Parameter(desc = "a comma-separated list of roles allowed to create addresses", name = "createAddressRoles") String createAddressRoles,
|
||||
@Parameter(desc = "a comma-separated list of roles allowed to delete addresses", name = "deleteAddressRoles") String deleteAddressRoles) throws Exception;
|
||||
|
||||
@Operation(desc = "Remove security settings for an address", impact = MBeanOperationInfo.ACTION)
|
||||
void removeSecuritySettings(@Parameter(desc = "an address match", name = "addressMatch") String addressMatch) throws Exception;
|
||||
|
@ -848,6 +849,36 @@ public interface ActiveMQServerControl {
|
|||
@Parameter(desc = "allow auto-created queues to be deleted automatically", name = "autoDeleteJmsQueues") boolean autoDeleteJmsQueues,
|
||||
@Parameter(desc = "allow topics to be created automatically", name = "autoCreateJmsTopics") boolean autoCreateJmsTopics,
|
||||
@Parameter(desc = "allow auto-created topics to be deleted automatically", name = "autoDeleteJmsTopics") boolean autoDeleteJmsTopics) throws Exception;
|
||||
/**
|
||||
* adds a new address setting for a specific address
|
||||
*/
|
||||
@Operation(desc = "Add address settings for addresses matching the addressMatch", impact = MBeanOperationInfo.ACTION)
|
||||
void addAddressSettings(@Parameter(desc = "an address match", name = "addressMatch") String addressMatch,
|
||||
@Parameter(desc = "the dead letter address setting", name = "DLA") String DLA,
|
||||
@Parameter(desc = "the expiry address setting", name = "expiryAddress") String expiryAddress,
|
||||
@Parameter(desc = "the expiry delay setting", name = "expiryDelay") long expiryDelay,
|
||||
@Parameter(desc = "are any queues created for this address a last value queue", name = "lastValueQueue") boolean lastValueQueue,
|
||||
@Parameter(desc = "the delivery attempts", name = "deliveryAttempts") int deliveryAttempts,
|
||||
@Parameter(desc = "the max size in bytes", name = "maxSizeBytes") long maxSizeBytes,
|
||||
@Parameter(desc = "the page size in bytes", name = "pageSizeBytes") int pageSizeBytes,
|
||||
@Parameter(desc = "the max number of pages in the soft memory cache", name = "pageMaxCacheSize") int pageMaxCacheSize,
|
||||
@Parameter(desc = "the redelivery delay", name = "redeliveryDelay") long redeliveryDelay,
|
||||
@Parameter(desc = "the redelivery delay multiplier", name = "redeliveryMultiplier") double redeliveryMultiplier,
|
||||
@Parameter(desc = "the maximum redelivery delay", name = "maxRedeliveryDelay") long maxRedeliveryDelay,
|
||||
@Parameter(desc = "the redistribution delay", name = "redistributionDelay") long redistributionDelay,
|
||||
@Parameter(desc = "do we send to the DLA when there is no where to route the message", name = "sendToDLAOnNoRoute") boolean sendToDLAOnNoRoute,
|
||||
@Parameter(desc = "the policy to use when the address is full", name = "addressFullMessagePolicy") String addressFullMessagePolicy,
|
||||
@Parameter(desc = "when a consumer falls below this threshold in terms of messages consumed per second it will be considered 'slow'", name = "slowConsumerThreshold") long slowConsumerThreshold,
|
||||
@Parameter(desc = "how often (in seconds) to check for slow consumers", name = "slowConsumerCheckPeriod") long slowConsumerCheckPeriod,
|
||||
@Parameter(desc = "the policy to use when a slow consumer is detected", name = "slowConsumerPolicy") String slowConsumerPolicy,
|
||||
@Parameter(desc = "allow jms queues to be created automatically", name = "autoCreateJmsQueues") boolean autoCreateJmsQueues,
|
||||
@Parameter(desc = "allow auto-created jms queues to be deleted automatically", name = "autoDeleteJmsQueues") boolean autoDeleteJmsQueues,
|
||||
@Parameter(desc = "allow jms topics to be created automatically", name = "autoCreateJmsTopics") boolean autoCreateJmsTopics,
|
||||
@Parameter(desc = "allow auto-created jms topics to be deleted automatically", name = "autoDeleteJmsTopics") boolean autoDeleteJmsTopics,
|
||||
@Parameter(desc = "allow queues to be created automatically", name = "autoCreateQueues") boolean autoCreateQueues,
|
||||
@Parameter(desc = "allow auto-created queues to be deleted automatically", name = "autoDeleteQueues") boolean autoDeleteQueues,
|
||||
@Parameter(desc = "allow topics to be created automatically", name = "autoCreateAddresses") boolean autoCreateAddresses,
|
||||
@Parameter(desc = "allow auto-created topics to be deleted automatically", name = "autoDeleteAddresses") boolean autoDeleteAddresses) throws Exception;
|
||||
|
||||
void removeAddressSettings(String addressMatch) throws Exception;
|
||||
|
||||
|
|
|
@ -165,7 +165,7 @@ public final class ObjectNameBuilder {
|
|||
* Returns the ObjectName used by JMSQueueControl.
|
||||
*/
|
||||
public ObjectName getJMSQueueObjectName(final String name) throws Exception {
|
||||
return createObjectName("Queue", name);
|
||||
return getQueueObjectName(SimpleString.toSimpleString(name), SimpleString.toSimpleString(name));
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
|
@ -237,14 +237,14 @@ public final class ClientSessionImpl implements ClientSessionInternal, FailureLi
|
|||
|
||||
@Override
|
||||
public void createQueue(final SimpleString address, final SimpleString queueName) throws ActiveMQException {
|
||||
internalCreateQueue(address, queueName, null, false, false);
|
||||
internalCreateQueue(address, queueName, null, false, false, false);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void createQueue(final SimpleString address,
|
||||
final SimpleString queueName,
|
||||
final boolean durable) throws ActiveMQException {
|
||||
internalCreateQueue(address, queueName, null, durable, false);
|
||||
internalCreateQueue(address, queueName, null, durable, false, false);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
@ -295,7 +295,7 @@ public final class ClientSessionImpl implements ClientSessionInternal, FailureLi
|
|||
final SimpleString queueName,
|
||||
final SimpleString filterString,
|
||||
final boolean durable) throws ActiveMQException {
|
||||
internalCreateQueue(address, queueName, filterString, durable, false);
|
||||
internalCreateQueue(address, queueName, filterString, durable, false, false);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
@ -306,28 +306,46 @@ public final class ClientSessionImpl implements ClientSessionInternal, FailureLi
|
|||
createQueue(SimpleString.toSimpleString(address), SimpleString.toSimpleString(queueName), SimpleString.toSimpleString(filterString), durable);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void createQueue(final SimpleString address,
|
||||
final SimpleString queueName,
|
||||
final SimpleString filterString,
|
||||
final boolean durable,
|
||||
final boolean autoCreated) throws ActiveMQException {
|
||||
internalCreateQueue(address, queueName, filterString, durable, false, autoCreated);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void createQueue(final String address,
|
||||
final String queueName,
|
||||
final String filterString,
|
||||
final boolean durable,
|
||||
final boolean autoCreated) throws ActiveMQException {
|
||||
createQueue(SimpleString.toSimpleString(address), SimpleString.toSimpleString(queueName), SimpleString.toSimpleString(filterString), durable, autoCreated);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void createTemporaryQueue(final SimpleString address, final SimpleString queueName) throws ActiveMQException {
|
||||
internalCreateQueue(address, queueName, null, false, true);
|
||||
internalCreateQueue(address, queueName, null, false, true, false);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void createTemporaryQueue(final String address, final String queueName) throws ActiveMQException {
|
||||
internalCreateQueue(SimpleString.toSimpleString(address), SimpleString.toSimpleString(queueName), null, false, true);
|
||||
internalCreateQueue(SimpleString.toSimpleString(address), SimpleString.toSimpleString(queueName), null, false, true, false);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void createTemporaryQueue(final SimpleString address,
|
||||
final SimpleString queueName,
|
||||
final SimpleString filter) throws ActiveMQException {
|
||||
internalCreateQueue(address, queueName, filter, false, true);
|
||||
internalCreateQueue(address, queueName, filter, false, true, false);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void createTemporaryQueue(final String address,
|
||||
final String queueName,
|
||||
final String filter) throws ActiveMQException {
|
||||
internalCreateQueue(SimpleString.toSimpleString(address), SimpleString.toSimpleString(queueName), SimpleString.toSimpleString(filter), false, true);
|
||||
internalCreateQueue(SimpleString.toSimpleString(address), SimpleString.toSimpleString(queueName), SimpleString.toSimpleString(filter), false, true, false);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
@ -1551,7 +1569,8 @@ public final class ClientSessionImpl implements ClientSessionInternal, FailureLi
|
|||
final SimpleString queueName,
|
||||
final SimpleString filterString,
|
||||
final boolean durable,
|
||||
final boolean temp) throws ActiveMQException {
|
||||
final boolean temp,
|
||||
final boolean autoCreated) throws ActiveMQException {
|
||||
checkClosed();
|
||||
|
||||
if (durable && temp) {
|
||||
|
@ -1560,7 +1579,7 @@ public final class ClientSessionImpl implements ClientSessionInternal, FailureLi
|
|||
|
||||
startCall();
|
||||
try {
|
||||
sessionContext.createQueue(address, queueName, filterString, durable, temp);
|
||||
sessionContext.createQueue(address, queueName, filterString, durable, temp, autoCreated);
|
||||
} finally {
|
||||
endCall();
|
||||
}
|
||||
|
|
|
@ -52,6 +52,7 @@ import org.apache.activemq.artemis.core.protocol.core.Packet;
|
|||
import org.apache.activemq.artemis.core.protocol.core.impl.wireformat.ActiveMQExceptionMessage;
|
||||
import org.apache.activemq.artemis.core.protocol.core.impl.wireformat.CreateAddressMessage;
|
||||
import org.apache.activemq.artemis.core.protocol.core.impl.wireformat.CreateQueueMessage;
|
||||
import org.apache.activemq.artemis.core.protocol.core.impl.wireformat.CreateQueueMessage_V2;
|
||||
import org.apache.activemq.artemis.core.protocol.core.impl.wireformat.CreateSessionMessage;
|
||||
import org.apache.activemq.artemis.core.protocol.core.impl.wireformat.CreateSharedQueueMessage;
|
||||
import org.apache.activemq.artemis.core.protocol.core.impl.wireformat.DisconnectConsumerMessage;
|
||||
|
@ -594,8 +595,9 @@ public class ActiveMQSessionContext extends SessionContext {
|
|||
SimpleString queueName,
|
||||
SimpleString filterString,
|
||||
boolean durable,
|
||||
boolean temp) throws ActiveMQException {
|
||||
CreateQueueMessage request = new CreateQueueMessage(address, queueName, filterString, durable, temp, true);
|
||||
boolean temp,
|
||||
boolean autoCreated) throws ActiveMQException {
|
||||
CreateQueueMessage request = new CreateQueueMessage_V2(address, queueName, filterString, durable, temp, autoCreated, true);
|
||||
sessionChannel.sendBlocking(request, PacketImpl.NULL_RESPONSE);
|
||||
}
|
||||
|
||||
|
|
|
@ -29,6 +29,7 @@ import org.apache.activemq.artemis.core.protocol.core.impl.wireformat.ClusterTop
|
|||
import org.apache.activemq.artemis.core.protocol.core.impl.wireformat.ClusterTopologyChangeMessage_V3;
|
||||
import org.apache.activemq.artemis.core.protocol.core.impl.wireformat.CreateAddressMessage;
|
||||
import org.apache.activemq.artemis.core.protocol.core.impl.wireformat.CreateQueueMessage;
|
||||
import org.apache.activemq.artemis.core.protocol.core.impl.wireformat.CreateQueueMessage_V2;
|
||||
import org.apache.activemq.artemis.core.protocol.core.impl.wireformat.CreateSessionMessage;
|
||||
import org.apache.activemq.artemis.core.protocol.core.impl.wireformat.CreateSessionResponseMessage;
|
||||
import org.apache.activemq.artemis.core.protocol.core.impl.wireformat.CreateSharedQueueMessage;
|
||||
|
@ -91,6 +92,7 @@ import static org.apache.activemq.artemis.core.protocol.core.impl.PacketImpl.CRE
|
|||
import static org.apache.activemq.artemis.core.protocol.core.impl.PacketImpl.CREATESESSION_RESP;
|
||||
import static org.apache.activemq.artemis.core.protocol.core.impl.PacketImpl.CREATE_ADDRESS;
|
||||
import static org.apache.activemq.artemis.core.protocol.core.impl.PacketImpl.CREATE_QUEUE;
|
||||
import static org.apache.activemq.artemis.core.protocol.core.impl.PacketImpl.CREATE_QUEUE_V2;
|
||||
import static org.apache.activemq.artemis.core.protocol.core.impl.PacketImpl.CREATE_SHARED_QUEUE;
|
||||
import static org.apache.activemq.artemis.core.protocol.core.impl.PacketImpl.DELETE_QUEUE;
|
||||
import static org.apache.activemq.artemis.core.protocol.core.impl.PacketImpl.DISCONNECT;
|
||||
|
@ -245,6 +247,10 @@ public abstract class PacketDecoder implements Serializable {
|
|||
packet = new CreateQueueMessage();
|
||||
break;
|
||||
}
|
||||
case CREATE_QUEUE_V2: {
|
||||
packet = new CreateQueueMessage_V2();
|
||||
break;
|
||||
}
|
||||
case CREATE_SHARED_QUEUE: {
|
||||
packet = new CreateSharedQueueMessage();
|
||||
break;
|
||||
|
|
|
@ -251,6 +251,8 @@ public class PacketImpl implements Packet {
|
|||
|
||||
public static final byte CREATE_ADDRESS = -11;
|
||||
|
||||
public static final byte CREATE_QUEUE_V2 = -12;
|
||||
|
||||
// Static --------------------------------------------------------
|
||||
|
||||
public PacketImpl(final byte type) {
|
||||
|
|
|
@ -22,17 +22,17 @@ import org.apache.activemq.artemis.core.protocol.core.impl.PacketImpl;
|
|||
|
||||
public class CreateQueueMessage extends PacketImpl {
|
||||
|
||||
private SimpleString address;
|
||||
protected SimpleString address;
|
||||
|
||||
private SimpleString queueName;
|
||||
protected SimpleString queueName;
|
||||
|
||||
private SimpleString filterString;
|
||||
protected SimpleString filterString;
|
||||
|
||||
private boolean durable;
|
||||
protected boolean durable;
|
||||
|
||||
private boolean temporary;
|
||||
protected boolean temporary;
|
||||
|
||||
private boolean requiresResponse;
|
||||
protected boolean requiresResponse;
|
||||
|
||||
public CreateQueueMessage(final SimpleString address,
|
||||
final SimpleString queueName,
|
||||
|
@ -55,16 +55,28 @@ public class CreateQueueMessage extends PacketImpl {
|
|||
}
|
||||
|
||||
// Public --------------------------------------------------------
|
||||
/**
|
||||
* @param createQueueMessageV2
|
||||
*/
|
||||
public CreateQueueMessage(byte createQueueMessageV2) {
|
||||
super(createQueueMessageV2);
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
StringBuffer buff = new StringBuffer(getParentString());
|
||||
buff.append("]");
|
||||
return buff.toString();
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getParentString() {
|
||||
StringBuffer buff = new StringBuffer(super.getParentString());
|
||||
buff.append(", address=" + address);
|
||||
buff.append(", queueName=" + queueName);
|
||||
buff.append(", filterString=" + filterString);
|
||||
buff.append(", durable=" + durable);
|
||||
buff.append(", temporary=" + temporary);
|
||||
buff.append("]");
|
||||
return buff.toString();
|
||||
}
|
||||
|
||||
|
|
|
@ -0,0 +1,99 @@
|
|||
/*
|
||||
* Licensed to the Apache Software Foundation (ASF) under one or more
|
||||
* contributor license agreements. See the NOTICE file distributed with
|
||||
* this work for additional information regarding copyright ownership.
|
||||
* The ASF licenses this file to You under the Apache License, Version 2.0
|
||||
* (the "License"); you may not use this file except in compliance with
|
||||
* the License. You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
package org.apache.activemq.artemis.core.protocol.core.impl.wireformat;
|
||||
|
||||
import org.apache.activemq.artemis.api.core.ActiveMQBuffer;
|
||||
import org.apache.activemq.artemis.api.core.SimpleString;
|
||||
|
||||
public class CreateQueueMessage_V2 extends CreateQueueMessage {
|
||||
|
||||
private boolean autoCreated;
|
||||
|
||||
public CreateQueueMessage_V2(final SimpleString address,
|
||||
final SimpleString queueName,
|
||||
final SimpleString filterString,
|
||||
final boolean durable,
|
||||
final boolean temporary,
|
||||
final boolean autoCreated,
|
||||
final boolean requiresResponse) {
|
||||
this();
|
||||
|
||||
this.address = address;
|
||||
this.queueName = queueName;
|
||||
this.filterString = filterString;
|
||||
this.durable = durable;
|
||||
this.temporary = temporary;
|
||||
this.autoCreated = autoCreated;
|
||||
this.requiresResponse = requiresResponse;
|
||||
}
|
||||
|
||||
public CreateQueueMessage_V2() {
|
||||
super(CREATE_QUEUE_V2);
|
||||
}
|
||||
|
||||
// Public --------------------------------------------------------
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
StringBuffer buff = new StringBuffer(super.getParentString());
|
||||
buff.append(", autoCreated=" + autoCreated);
|
||||
buff.append("]");
|
||||
return buff.toString();
|
||||
}
|
||||
|
||||
public boolean isAutoCreated() {
|
||||
return autoCreated;
|
||||
}
|
||||
|
||||
public void setAutoCreated(boolean autoCreated) {
|
||||
this.autoCreated = autoCreated;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void encodeRest(final ActiveMQBuffer buffer) {
|
||||
super.encodeRest(buffer);
|
||||
buffer.writeBoolean(autoCreated);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void decodeRest(final ActiveMQBuffer buffer) {
|
||||
super.decodeRest(buffer);
|
||||
autoCreated = buffer.readBoolean();
|
||||
}
|
||||
|
||||
@Override
|
||||
public int hashCode() {
|
||||
final int prime = 31;
|
||||
int result = super.hashCode();
|
||||
result = prime * result + (autoCreated ? 1231 : 1237);
|
||||
return result;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean equals(Object obj) {
|
||||
if (this == obj)
|
||||
return true;
|
||||
if (!super.equals(obj))
|
||||
return false;
|
||||
if (!(obj instanceof CreateQueueMessage_V2))
|
||||
return false;
|
||||
CreateQueueMessage_V2 other = (CreateQueueMessage_V2) obj;
|
||||
if (autoCreated != other.autoCreated)
|
||||
return false;
|
||||
return true;
|
||||
}
|
||||
}
|
|
@ -36,6 +36,8 @@ public class Role implements Serializable {
|
|||
|
||||
private final boolean createAddress;
|
||||
|
||||
private final boolean deleteAddress;
|
||||
|
||||
private final boolean createDurableQueue;
|
||||
|
||||
private final boolean deleteDurableQueue;
|
||||
|
@ -49,7 +51,7 @@ public class Role implements Serializable {
|
|||
private final boolean browse;
|
||||
|
||||
public JsonObject toJson() {
|
||||
return JsonLoader.createObjectBuilder().add("name", name).add("send", send).add("consume", consume).add("createDurableQueue", createDurableQueue).add("deleteDurableQueue", deleteDurableQueue).add("createNonDurableQueue", createNonDurableQueue).add("deleteNonDurableQueue", deleteNonDurableQueue).add("manage", manage).add("browse", browse).add("createAddress", createAddress).build();
|
||||
return JsonLoader.createObjectBuilder().add("name", name).add("send", send).add("consume", consume).add("createDurableQueue", createDurableQueue).add("deleteDurableQueue", deleteDurableQueue).add("createNonDurableQueue", createNonDurableQueue).add("deleteNonDurableQueue", deleteNonDurableQueue).add("manage", manage).add("browse", browse).add("createAddress", createAddress).add("deleteAddress", deleteAddress).build();
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -87,8 +89,8 @@ public class Role implements Serializable {
|
|||
final boolean manage,
|
||||
final boolean browse) {
|
||||
// This constructor exists for version compatibility on the API. If either createDurableQueue or createNonDurableQueue
|
||||
// is true then createAddress will be true.
|
||||
this(name, send, consume, createDurableQueue, deleteDurableQueue, createNonDurableQueue, deleteNonDurableQueue, manage, browse, createDurableQueue || createNonDurableQueue);
|
||||
// is true then createAddress will be true. If either deleteDurableQueue or deleteNonDurableQueue is true then deleteAddress will be true.
|
||||
this(name, send, consume, createDurableQueue, deleteDurableQueue, createNonDurableQueue, deleteNonDurableQueue, manage, browse, createDurableQueue || createNonDurableQueue, deleteDurableQueue || deleteNonDurableQueue);
|
||||
}
|
||||
|
||||
public Role(final String name,
|
||||
|
@ -100,7 +102,8 @@ public class Role implements Serializable {
|
|||
final boolean deleteNonDurableQueue,
|
||||
final boolean manage,
|
||||
final boolean browse,
|
||||
final boolean createAddress) {
|
||||
final boolean createAddress,
|
||||
final boolean deleteAddress) {
|
||||
if (name == null) {
|
||||
throw new NullPointerException("name is null");
|
||||
}
|
||||
|
@ -108,6 +111,7 @@ public class Role implements Serializable {
|
|||
this.send = send;
|
||||
this.consume = consume;
|
||||
this.createAddress = createAddress;
|
||||
this.deleteAddress = deleteAddress;
|
||||
this.createDurableQueue = createDurableQueue;
|
||||
this.deleteDurableQueue = deleteDurableQueue;
|
||||
this.createNonDurableQueue = createNonDurableQueue;
|
||||
|
@ -132,6 +136,10 @@ public class Role implements Serializable {
|
|||
return createAddress;
|
||||
}
|
||||
|
||||
public boolean isDeleteAddress() {
|
||||
return deleteAddress;
|
||||
}
|
||||
|
||||
public boolean isCreateDurableQueue() {
|
||||
return createDurableQueue;
|
||||
}
|
||||
|
@ -161,6 +169,9 @@ public class Role implements Serializable {
|
|||
if (createAddress) {
|
||||
stringReturn.append(" createAddress ");
|
||||
}
|
||||
if (deleteAddress) {
|
||||
stringReturn.append(" deleteAddress ");
|
||||
}
|
||||
if (createDurableQueue) {
|
||||
stringReturn.append(" createDurableQueue ");
|
||||
}
|
||||
|
@ -202,6 +213,9 @@ public class Role implements Serializable {
|
|||
if (createAddress != role.createAddress) {
|
||||
return false;
|
||||
}
|
||||
if (deleteAddress != role.deleteAddress) {
|
||||
return false;
|
||||
}
|
||||
if (createDurableQueue != role.createDurableQueue) {
|
||||
return false;
|
||||
}
|
||||
|
@ -237,6 +251,7 @@ public class Role implements Serializable {
|
|||
result = 31 * result + (send ? 1 : 0);
|
||||
result = 31 * result + (consume ? 1 : 0);
|
||||
result = 31 * result + (createAddress ? 1 : 0);
|
||||
result = 31 * result + (deleteAddress ? 1 : 0);
|
||||
result = 31 * result + (createDurableQueue ? 1 : 0);
|
||||
result = 31 * result + (deleteDurableQueue ? 1 : 0);
|
||||
result = 31 * result + (createNonDurableQueue ? 1 : 0);
|
||||
|
|
|
@ -172,7 +172,8 @@ public abstract class SessionContext {
|
|||
SimpleString queueName,
|
||||
SimpleString filterString,
|
||||
boolean durable,
|
||||
boolean temp) throws ActiveMQException;
|
||||
boolean temp,
|
||||
boolean autoCreated) throws ActiveMQException;
|
||||
|
||||
public abstract ClientSession.QueueQuery queueQuery(SimpleString queueName) throws ActiveMQException;
|
||||
|
||||
|
|
|
@ -33,7 +33,8 @@ public class SecurityFormatter {
|
|||
String deleteNonDurableQueueRoles,
|
||||
String manageRoles,
|
||||
String browseRoles,
|
||||
String createAddressRoles) {
|
||||
String createAddressRoles,
|
||||
String deleteAddressRoles) {
|
||||
List<String> createDurableQueue = toList(createDurableQueueRoles);
|
||||
List<String> deleteDurableQueue = toList(deleteDurableQueueRoles);
|
||||
List<String> createNonDurableQueue = toList(createNonDurableQueueRoles);
|
||||
|
@ -43,6 +44,7 @@ public class SecurityFormatter {
|
|||
List<String> manage = toList(manageRoles);
|
||||
List<String> browse = toList(browseRoles);
|
||||
List<String> createAddress = toList(createAddressRoles);
|
||||
List<String> deleteAddress = toList(deleteAddressRoles);
|
||||
|
||||
Set<String> allRoles = new HashSet<>();
|
||||
allRoles.addAll(createDurableQueue);
|
||||
|
@ -54,10 +56,11 @@ public class SecurityFormatter {
|
|||
allRoles.addAll(manage);
|
||||
allRoles.addAll(browse);
|
||||
allRoles.addAll(createAddress);
|
||||
allRoles.addAll(deleteAddress);
|
||||
|
||||
Set<Role> roles = new HashSet<>(allRoles.size());
|
||||
for (String role : allRoles) {
|
||||
roles.add(new Role(role, send.contains(role), consume.contains(role), createDurableQueue.contains(role), deleteDurableQueue.contains(role), createNonDurableQueue.contains(role), deleteNonDurableQueue.contains(role), manageRoles.contains(role), browse.contains(role), createAddressRoles.contains(role)));
|
||||
roles.add(new Role(role, send.contains(role), consume.contains(role), createDurableQueue.contains(role), deleteDurableQueue.contains(role), createNonDurableQueue.contains(role), deleteNonDurableQueue.contains(role), manageRoles.contains(role), browse.contains(role), createAddressRoles.contains(role), deleteAddressRoles.contains(role)));
|
||||
}
|
||||
return roles;
|
||||
}
|
||||
|
|
|
@ -49,7 +49,7 @@ pwd
|
|||
sleep 5
|
||||
|
||||
./artemis producer
|
||||
./artemis consumer
|
||||
./artemis consumer --receive-timeout 10000 --break-on-null
|
||||
|
||||
./artemis stop
|
||||
|
||||
|
@ -64,7 +64,7 @@ sleep 5
|
|||
sleep 5
|
||||
|
||||
./artemis producer
|
||||
./artemis consumer
|
||||
./artemis consumer --receive-timeout 10000 --break-on-null
|
||||
|
||||
./artemis-service stop
|
||||
|
||||
|
|
|
@ -80,6 +80,8 @@ under the License.
|
|||
<permission type="deleteNonDurableQueue" roles="manager"/>
|
||||
<permission type="createDurableQueue" roles="manager"/>
|
||||
<permission type="deleteDurableQueue" roles="manager"/>
|
||||
<permission type="createAddress" roles="manager"/>
|
||||
<permission type="deleteAddress" roles="manager"/>
|
||||
<permission type="consume" roles="manager"/>
|
||||
<permission type="send" roles="manager"/>
|
||||
<!-- we need this otherwise ./artemis data imp wouldn't work -->
|
||||
|
@ -97,7 +99,7 @@ under the License.
|
|||
<max-size-bytes>-1</max-size-bytes>
|
||||
<message-counter-history-day-limit>10</message-counter-history-day-limit>
|
||||
<address-full-policy>PAGE</address-full-policy>
|
||||
<auto-create-jms-queues>true</auto-create-jms-queues>
|
||||
<auto-create-queues>true</auto-create-queues>
|
||||
</address-setting>
|
||||
</address-settings>
|
||||
</core>
|
||||
|
|
|
@ -410,7 +410,7 @@ public class ActiveMQMessageProducer implements MessageProducer, QueueSender, To
|
|||
// TODO is it right to use the address for the queue name here?
|
||||
clientSession.createTemporaryQueue(address, address);
|
||||
} else {
|
||||
clientSession.createQueue(address, address, null, true);
|
||||
clientSession.createQueue(address, address, null, true, true);
|
||||
}
|
||||
} else if (!destination.isQueue() && query.isAutoCreateJmsTopics()) {
|
||||
clientSession.createAddress(address, true, true);
|
||||
|
|
|
@ -301,10 +301,9 @@ public class ActiveMQSession implements QueueSession, TopicSession {
|
|||
|
||||
if (!response.isExists()) {
|
||||
if (jbd.isQueue() && response.isAutoCreateJmsQueues()) {
|
||||
// TODO create queue here in such a way that it is deleted when consumerCount == 0
|
||||
// perhaps just relying on the broker to do it is simplest (i.e. deleteOnNoConsumers)
|
||||
session.createAddress(jbd.getSimpleAddress(), false, true);
|
||||
session.createQueue(jbd.getSimpleAddress(), jbd.getSimpleAddress(), null, true);
|
||||
session.createQueue(jbd.getSimpleAddress(), jbd.getSimpleAddress(), null, true, true);
|
||||
} else if (!jbd.isQueue() && response.isAutoCreateJmsTopics()) {
|
||||
session.createAddress(jbd.getSimpleAddress(), true, true);
|
||||
} else {
|
||||
|
@ -647,9 +646,7 @@ public class ActiveMQSession implements QueueSession, TopicSession {
|
|||
*/
|
||||
if (!response.isExists() || !response.getQueueNames().contains(dest.getSimpleAddress())) {
|
||||
if (response.isAutoCreateJmsQueues()) {
|
||||
// TODO create queue here in such a way that it is deleted when consumerCount == 0
|
||||
// perhaps just relying on the broker to do it is simplest (i.e. deleteOnNoConsumers)
|
||||
session.createQueue(dest.getSimpleAddress(), dest.getSimpleAddress(), true);
|
||||
session.createQueue(dest.getSimpleAddress(), dest.getSimpleAddress(), null, true, true);
|
||||
} else {
|
||||
throw new InvalidDestinationException("Destination " + dest.getName() + " does not exist");
|
||||
}
|
||||
|
@ -797,7 +794,7 @@ public class ActiveMQSession implements QueueSession, TopicSession {
|
|||
AddressQuery response = session.addressQuery(new SimpleString(activeMQDestination.getAddress()));
|
||||
if (!response.isExists()) {
|
||||
if (response.isAutoCreateJmsQueues()) {
|
||||
session.createQueue(activeMQDestination.getSimpleAddress(), activeMQDestination.getSimpleAddress(), true);
|
||||
session.createQueue(activeMQDestination.getSimpleAddress(), activeMQDestination.getSimpleAddress(), null, true, true);
|
||||
} else {
|
||||
throw new InvalidDestinationException("Destination " + activeMQDestination.getName() + " does not exist");
|
||||
}
|
||||
|
|
|
@ -1637,9 +1637,9 @@ public class JMSServerManagerImpl implements JMSServerManager, ActivateCallback
|
|||
// long consumerCount = queue.getConsumerCount();
|
||||
// long messageCount = queue.getMessageCount();
|
||||
//
|
||||
// if (address.toString().startsWith(ActiveMQDestination.JMS_QUEUE_ADDRESS_PREFIX) && settings.getAutoDeleteJmsQueues() && queue.getMessageCount() == 0) {
|
||||
// if (address.toString().startsWith(ActiveMQDestination.JMS_QUEUE_ADDRESS_PREFIX) && settings.isAutoDeleteJmsQueues() && queue.getMessageCount() == 0) {
|
||||
// if (ActiveMQJMSServerLogger.LOGGER.isDebugEnabled()) {
|
||||
// ActiveMQJMSServerLogger.LOGGER.debug("deleting auto-created queue \"" + queueName + ".\" consumerCount = " + consumerCount + "; messageCount = " + messageCount + "; getAutoDeleteJmsQueues = " + settings.getAutoDeleteJmsQueues());
|
||||
// ActiveMQJMSServerLogger.LOGGER.debug("deleting auto-created queue \"" + queueName + ".\" consumerCount = " + consumerCount + "; messageCount = " + messageCount + "; isAutoDeleteJmsQueues = " + settings.isAutoDeleteJmsQueues());
|
||||
// }
|
||||
//
|
||||
// return destroyQueue(queueName.toString().substring(ActiveMQDestination.JMS_QUEUE_ADDRESS_PREFIX.length()), false);
|
||||
|
|
|
@ -722,7 +722,6 @@ public class OpenWireConnection extends AbstractRemotingConnection implements Se
|
|||
server.getSecurityStore().check(qName, checkType, this);
|
||||
server.checkQueueCreationLimit(getUsername());
|
||||
server.createQueue(qName, qName, null, connInfo == null ? null : SimpleString.toSimpleString(connInfo.getUserName()), true, false);
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -168,7 +168,7 @@ public class AMQSession implements SessionCallback {
|
|||
BindingQueryResult bindingQuery = server.bindingQuery(queueName);
|
||||
QueueQueryResult queueBinding = server.queueQuery(queueName);
|
||||
|
||||
boolean isAutoCreate = bindingQuery.isExists() ? bindingQuery.isAutoCreateJmsQueues() : true;
|
||||
boolean isAutoCreate = bindingQuery.isExists() ? true : bindingQuery.isAutoCreateJmsQueues();
|
||||
|
||||
if (!queueBinding.isExists()) {
|
||||
if (isAutoCreate) {
|
||||
|
|
|
@ -39,8 +39,10 @@ import org.apache.activemq.artemis.core.remoting.FailureListener;
|
|||
import org.apache.activemq.artemis.core.remoting.impl.netty.TransportConstants;
|
||||
import org.apache.activemq.artemis.core.server.ActiveMQServerLogger;
|
||||
import org.apache.activemq.artemis.core.server.ServerMessage;
|
||||
import org.apache.activemq.artemis.core.server.ServerSession;
|
||||
import org.apache.activemq.artemis.core.server.impl.AddressInfo;
|
||||
import org.apache.activemq.artemis.core.server.impl.ServerMessageImpl;
|
||||
import org.apache.activemq.artemis.core.settings.impl.AddressSettings;
|
||||
import org.apache.activemq.artemis.spi.core.protocol.RemotingConnection;
|
||||
import org.apache.activemq.artemis.spi.core.remoting.Acceptor;
|
||||
import org.apache.activemq.artemis.spi.core.remoting.Connection;
|
||||
|
@ -251,6 +253,7 @@ public final class StompConnection implements RemotingConnection {
|
|||
return res;
|
||||
}
|
||||
|
||||
// TODO this should take a type - send or receive so it knows whether to check the address or the queue
|
||||
public void checkDestination(String destination) throws ActiveMQStompException {
|
||||
if (!manager.destinationExists(destination)) {
|
||||
throw BUNDLE.destinationNotExist(destination).setHandler(frameHandler);
|
||||
|
@ -259,17 +262,24 @@ public final class StompConnection implements RemotingConnection {
|
|||
|
||||
public boolean autoCreateDestinationIfPossible(String queue, AddressInfo.RoutingType routingType) throws ActiveMQStompException {
|
||||
boolean result = false;
|
||||
ServerSession session = getSession().getSession();
|
||||
|
||||
try {
|
||||
if (manager.getServer().getAddressInfo(SimpleString.toSimpleString(queue)) == null) {
|
||||
// TODO check here to see if auto-creation is enabled
|
||||
if (routingType.equals(AddressInfo.RoutingType.MULTICAST)) {
|
||||
manager.getServer().createOrUpdateAddressInfo(new AddressInfo(SimpleString.toSimpleString(queue)).setAutoCreated(true));
|
||||
AddressSettings addressSettings = manager.getServer().getAddressSettingsRepository().getMatch(queue);
|
||||
if (routingType != null && routingType.equals(AddressInfo.RoutingType.MULTICAST) && addressSettings.isAutoCreateAddresses()) {
|
||||
session.createAddress(SimpleString.toSimpleString(queue), true, true);
|
||||
result = true;
|
||||
} else {
|
||||
manager.getServer().createOrUpdateAddressInfo(new AddressInfo(SimpleString.toSimpleString(queue)).setRoutingType(AddressInfo.RoutingType.ANYCAST).setAutoCreated(true));
|
||||
manager.getServer().createQueue(SimpleString.toSimpleString(queue), SimpleString.toSimpleString(queue), null, null, true, false, true);
|
||||
if (addressSettings.isAutoCreateAddresses()) {
|
||||
session.createAddress(SimpleString.toSimpleString(queue), false, true);
|
||||
result = true;
|
||||
}
|
||||
if (addressSettings.isAutoCreateQueues()) {
|
||||
session.createQueue(SimpleString.toSimpleString(queue), SimpleString.toSimpleString(queue), null, false, true, null, null, true);
|
||||
result = true;
|
||||
}
|
||||
}
|
||||
result = true;
|
||||
}
|
||||
} catch (ActiveMQQueueExistsException e) {
|
||||
// ignore
|
||||
|
@ -555,6 +565,10 @@ public final class StompConnection implements RemotingConnection {
|
|||
return manager.createServerMessage();
|
||||
}
|
||||
|
||||
public StompSession getSession() throws ActiveMQStompException {
|
||||
return getSession(null);
|
||||
}
|
||||
|
||||
public StompSession getSession(String txID) throws ActiveMQStompException {
|
||||
StompSession session = null;
|
||||
try {
|
||||
|
|
|
@ -125,6 +125,10 @@ public final class FileConfigurationParser extends XMLConfigurationUtil {
|
|||
|
||||
private static final String BROWSE_NAME = "browse";
|
||||
|
||||
private static final String CREATEADDRESS_NAME = "createAddress";
|
||||
|
||||
private static final String DELETEADDRESS_NAME = "deleteAddress";
|
||||
|
||||
// Address parsing
|
||||
|
||||
private static final String DEAD_LETTER_ADDRESS_NODE_NAME = "dead-letter-address";
|
||||
|
@ -171,6 +175,14 @@ public final class FileConfigurationParser extends XMLConfigurationUtil {
|
|||
|
||||
private static final String AUTO_DELETE_JMS_TOPICS = "auto-delete-jms-topics";
|
||||
|
||||
private static final String AUTO_CREATE_QUEUES = "auto-create-queues";
|
||||
|
||||
private static final String AUTO_DELETE_QUEUES = "auto-delete-queues";
|
||||
|
||||
private static final String AUTO_CREATE_ADDRESSES = "auto-create-addresses";
|
||||
|
||||
private static final String AUTO_DELETE_ADDRESSES = "auto-delete-addresses";
|
||||
|
||||
private static final String MANAGEMENT_BROWSE_PAGE_SIZE = "management-browse-page-size";
|
||||
|
||||
private static final String MAX_CONNECTIONS_NODE_NAME = "max-connections";
|
||||
|
@ -696,6 +708,8 @@ public final class FileConfigurationParser extends XMLConfigurationUtil {
|
|||
ArrayList<String> deleteNonDurableQueue = new ArrayList<>();
|
||||
ArrayList<String> manageRoles = new ArrayList<>();
|
||||
ArrayList<String> browseRoles = new ArrayList<>();
|
||||
ArrayList<String> createAddressRoles = new ArrayList<>();
|
||||
ArrayList<String> deleteAddressRoles = new ArrayList<>();
|
||||
ArrayList<String> allRoles = new ArrayList<>();
|
||||
NodeList children = node.getChildNodes();
|
||||
for (int i = 0; i < children.getLength(); i++) {
|
||||
|
@ -726,6 +740,10 @@ public final class FileConfigurationParser extends XMLConfigurationUtil {
|
|||
manageRoles.add(role.trim());
|
||||
} else if (BROWSE_NAME.equals(type)) {
|
||||
browseRoles.add(role.trim());
|
||||
} else if (CREATEADDRESS_NAME.equals(type)) {
|
||||
createAddressRoles.add(role.trim());
|
||||
} else if (DELETEADDRESS_NAME.equals(type)) {
|
||||
deleteAddressRoles.add(role.trim());
|
||||
} else {
|
||||
ActiveMQServerLogger.LOGGER.rolePermissionConfigurationError(type);
|
||||
}
|
||||
|
@ -842,6 +860,14 @@ public final class FileConfigurationParser extends XMLConfigurationUtil {
|
|||
addressSettings.setAutoCreateJmsTopics(XMLUtil.parseBoolean(child));
|
||||
} else if (AUTO_DELETE_JMS_TOPICS.equalsIgnoreCase(name)) {
|
||||
addressSettings.setAutoDeleteJmsTopics(XMLUtil.parseBoolean(child));
|
||||
} else if (AUTO_CREATE_QUEUES.equalsIgnoreCase(name)) {
|
||||
addressSettings.setAutoCreateQueues(XMLUtil.parseBoolean(child));
|
||||
} else if (AUTO_DELETE_QUEUES.equalsIgnoreCase(name)) {
|
||||
addressSettings.setAutoDeleteQueues(XMLUtil.parseBoolean(child));
|
||||
} else if (AUTO_CREATE_ADDRESSES.equalsIgnoreCase(name)) {
|
||||
addressSettings.setAutoCreateAddresses(XMLUtil.parseBoolean(child));
|
||||
} else if (AUTO_DELETE_ADDRESSES.equalsIgnoreCase(name)) {
|
||||
addressSettings.setAutoDeleteAddresses(XMLUtil.parseBoolean(child));
|
||||
} else if (MANAGEMENT_BROWSE_PAGE_SIZE.equalsIgnoreCase(name)) {
|
||||
addressSettings.setManagementBrowsePageSize(XMLUtil.parseInt(child));
|
||||
}
|
||||
|
|
|
@ -67,7 +67,6 @@ import org.apache.activemq.artemis.core.postoffice.Binding;
|
|||
import org.apache.activemq.artemis.core.postoffice.Bindings;
|
||||
import org.apache.activemq.artemis.core.postoffice.DuplicateIDCache;
|
||||
import org.apache.activemq.artemis.core.postoffice.PostOffice;
|
||||
import org.apache.activemq.artemis.core.postoffice.QueueBinding;
|
||||
import org.apache.activemq.artemis.core.postoffice.impl.LocalQueueBinding;
|
||||
import org.apache.activemq.artemis.core.remoting.server.RemotingService;
|
||||
import org.apache.activemq.artemis.core.security.CheckType;
|
||||
|
@ -75,7 +74,6 @@ import org.apache.activemq.artemis.core.security.Role;
|
|||
import org.apache.activemq.artemis.core.server.ActiveMQMessageBundle;
|
||||
import org.apache.activemq.artemis.core.server.ActiveMQServer;
|
||||
import org.apache.activemq.artemis.core.server.ActiveMQServerLogger;
|
||||
import org.apache.activemq.artemis.core.server.BindingQueryResult;
|
||||
import org.apache.activemq.artemis.core.server.ConnectorServiceFactory;
|
||||
import org.apache.activemq.artemis.core.server.Consumer;
|
||||
import org.apache.activemq.artemis.core.server.JournalType;
|
||||
|
@ -789,12 +787,18 @@ public class ActiveMQServerControlImpl extends AbstractControl implements Active
|
|||
|
||||
@Override
|
||||
public String getAddressInfo(String address) throws ActiveMQAddressDoesNotExistException {
|
||||
AddressInfo addressInfo = server.getAddressInfo(SimpleString.toSimpleString(address));
|
||||
if (addressInfo == null) {
|
||||
throw ActiveMQMessageBundle.BUNDLE.addressDoesNotExist(SimpleString.toSimpleString(address));
|
||||
}
|
||||
else {
|
||||
return addressInfo.toString();
|
||||
checkStarted();
|
||||
|
||||
clearIO();
|
||||
try {
|
||||
AddressInfo addressInfo = server.getAddressInfo(SimpleString.toSimpleString(address));
|
||||
if (addressInfo == null) {
|
||||
throw ActiveMQMessageBundle.BUNDLE.addressDoesNotExist(SimpleString.toSimpleString(address));
|
||||
} else {
|
||||
return addressInfo.toString();
|
||||
}
|
||||
} finally {
|
||||
blockOnIO();
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -1600,7 +1604,7 @@ public class ActiveMQServerControlImpl extends AbstractControl implements Active
|
|||
final String deleteNonDurableQueueRoles,
|
||||
final String manageRoles,
|
||||
final String browseRoles) throws Exception {
|
||||
addSecuritySettings(addressMatch, sendRoles, consumeRoles, createDurableQueueRoles, deleteDurableQueueRoles, createNonDurableQueueRoles, deleteNonDurableQueueRoles, manageRoles, browseRoles, "");
|
||||
addSecuritySettings(addressMatch, sendRoles, consumeRoles, createDurableQueueRoles, deleteDurableQueueRoles, createNonDurableQueueRoles, deleteNonDurableQueueRoles, manageRoles, browseRoles, "", "");
|
||||
}
|
||||
|
||||
@Override
|
||||
|
@ -1613,16 +1617,17 @@ public class ActiveMQServerControlImpl extends AbstractControl implements Active
|
|||
final String deleteNonDurableQueueRoles,
|
||||
final String manageRoles,
|
||||
final String browseRoles,
|
||||
final String createAddressRoles) throws Exception {
|
||||
final String createAddressRoles,
|
||||
final String deleteAddressRoles) throws Exception {
|
||||
checkStarted();
|
||||
|
||||
clearIO();
|
||||
try {
|
||||
Set<Role> roles = SecurityFormatter.createSecurity(sendRoles, consumeRoles, createDurableQueueRoles, deleteDurableQueueRoles, createNonDurableQueueRoles, deleteNonDurableQueueRoles, manageRoles, browseRoles, createAddressRoles);
|
||||
Set<Role> roles = SecurityFormatter.createSecurity(sendRoles, consumeRoles, createDurableQueueRoles, deleteDurableQueueRoles, createNonDurableQueueRoles, deleteNonDurableQueueRoles, manageRoles, browseRoles, createAddressRoles, deleteAddressRoles);
|
||||
|
||||
server.getSecurityRepository().addMatch(addressMatch, roles);
|
||||
|
||||
PersistedRoles persistedRoles = new PersistedRoles(addressMatch, sendRoles, consumeRoles, createDurableQueueRoles, deleteDurableQueueRoles, createNonDurableQueueRoles, deleteNonDurableQueueRoles, manageRoles, browseRoles, createAddressRoles);
|
||||
PersistedRoles persistedRoles = new PersistedRoles(addressMatch, sendRoles, consumeRoles, createDurableQueueRoles, deleteDurableQueueRoles, createNonDurableQueueRoles, deleteNonDurableQueueRoles, manageRoles, browseRoles, createAddressRoles, deleteAddressRoles);
|
||||
|
||||
storageManager.storeSecurityRoles(persistedRoles);
|
||||
} finally {
|
||||
|
@ -1697,7 +1702,31 @@ public class ActiveMQServerControlImpl extends AbstractControl implements Active
|
|||
if (addressSettings.getExpiryAddress() != null) {
|
||||
settings.add("expiryAddress", addressSettings.getExpiryAddress().toString());
|
||||
}
|
||||
return settings.add("expiryDelay", addressSettings.getExpiryDelay()).add("maxDeliveryAttempts", addressSettings.getMaxDeliveryAttempts()).add("pageCacheMaxSize", addressSettings.getPageCacheMaxSize()).add("maxSizeBytes", addressSettings.getMaxSizeBytes()).add("pageSizeBytes", addressSettings.getPageSizeBytes()).add("redeliveryDelay", addressSettings.getRedeliveryDelay()).add("redeliveryMultiplier", addressSettings.getRedeliveryMultiplier()).add("maxRedeliveryDelay", addressSettings.getMaxRedeliveryDelay()).add("redistributionDelay", addressSettings.getRedistributionDelay()).add("lastValueQueue", addressSettings.isLastValueQueue()).add("sendToDLAOnNoRoute", addressSettings.isSendToDLAOnNoRoute()).add("addressFullMessagePolicy", policy).add("slowConsumerThreshold", addressSettings.getSlowConsumerThreshold()).add("slowConsumerCheckPeriod", addressSettings.getSlowConsumerCheckPeriod()).add("slowConsumerPolicy", consumerPolicy).add("autoCreateJmsQueues", addressSettings.isAutoCreateJmsQueues()).add("autoCreateJmsTopics", addressSettings.isAutoCreateJmsTopics()).add("autoDeleteJmsQueues", addressSettings.getAutoDeleteJmsQueues()).add("autoDeleteJmsTopics", addressSettings.getAutoDeleteJmsQueues()).build().toString();
|
||||
return settings.add("expiryDelay", addressSettings.getExpiryDelay())
|
||||
.add("maxDeliveryAttempts", addressSettings.getMaxDeliveryAttempts())
|
||||
.add("pageCacheMaxSize", addressSettings.getPageCacheMaxSize())
|
||||
.add("maxSizeBytes", addressSettings.getMaxSizeBytes())
|
||||
.add("pageSizeBytes", addressSettings.getPageSizeBytes())
|
||||
.add("redeliveryDelay", addressSettings.getRedeliveryDelay())
|
||||
.add("redeliveryMultiplier", addressSettings.getRedeliveryMultiplier())
|
||||
.add("maxRedeliveryDelay", addressSettings.getMaxRedeliveryDelay())
|
||||
.add("redistributionDelay", addressSettings.getRedistributionDelay())
|
||||
.add("lastValueQueue", addressSettings.isLastValueQueue())
|
||||
.add("sendToDLAOnNoRoute", addressSettings.isSendToDLAOnNoRoute())
|
||||
.add("addressFullMessagePolicy", policy)
|
||||
.add("slowConsumerThreshold", addressSettings.getSlowConsumerThreshold())
|
||||
.add("slowConsumerCheckPeriod", addressSettings.getSlowConsumerCheckPeriod())
|
||||
.add("slowConsumerPolicy", consumerPolicy)
|
||||
.add("autoCreateJmsQueues", addressSettings.isAutoCreateJmsQueues())
|
||||
.add("autoCreateJmsTopics", addressSettings.isAutoCreateJmsTopics())
|
||||
.add("autoDeleteJmsQueues", addressSettings.isAutoDeleteJmsQueues())
|
||||
.add("autoDeleteJmsTopics", addressSettings.isAutoDeleteJmsQueues())
|
||||
.add("autoCreateQueues", addressSettings.isAutoCreateQueues())
|
||||
.add("autoDeleteQueues", addressSettings.isAutoDeleteQueues())
|
||||
.add("autoCreateAddress", addressSettings.isAutoCreateAddresses())
|
||||
.add("autoDeleteAddress", addressSettings.isAutoDeleteAddresses())
|
||||
.build()
|
||||
.toString();
|
||||
}
|
||||
|
||||
@Override
|
||||
|
@ -1723,6 +1752,36 @@ public class ActiveMQServerControlImpl extends AbstractControl implements Active
|
|||
final boolean autoDeleteJmsQueues,
|
||||
final boolean autoCreateJmsTopics,
|
||||
final boolean autoDeleteJmsTopics) throws Exception {
|
||||
addAddressSettings(address, DLA, expiryAddress, expiryDelay, lastValueQueue, deliveryAttempts, maxSizeBytes, pageSizeBytes, pageMaxCacheSize, redeliveryDelay, redeliveryMultiplier, maxRedeliveryDelay, redistributionDelay, sendToDLAOnNoRoute, addressFullMessagePolicy, slowConsumerThreshold, slowConsumerCheckPeriod, slowConsumerPolicy, autoCreateJmsQueues, autoDeleteJmsQueues, autoCreateJmsTopics, autoDeleteJmsTopics, AddressSettings.DEFAULT_AUTO_CREATE_QUEUES, AddressSettings.DEFAULT_AUTO_DELETE_QUEUES, AddressSettings.DEFAULT_AUTO_CREATE_ADDRESSES, AddressSettings.DEFAULT_AUTO_DELETE_ADDRESSES);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void addAddressSettings(final String address,
|
||||
final String DLA,
|
||||
final String expiryAddress,
|
||||
final long expiryDelay,
|
||||
final boolean lastValueQueue,
|
||||
final int deliveryAttempts,
|
||||
final long maxSizeBytes,
|
||||
final int pageSizeBytes,
|
||||
final int pageMaxCacheSize,
|
||||
final long redeliveryDelay,
|
||||
final double redeliveryMultiplier,
|
||||
final long maxRedeliveryDelay,
|
||||
final long redistributionDelay,
|
||||
final boolean sendToDLAOnNoRoute,
|
||||
final String addressFullMessagePolicy,
|
||||
final long slowConsumerThreshold,
|
||||
final long slowConsumerCheckPeriod,
|
||||
final String slowConsumerPolicy,
|
||||
final boolean autoCreateJmsQueues,
|
||||
final boolean autoDeleteJmsQueues,
|
||||
final boolean autoCreateJmsTopics,
|
||||
final boolean autoDeleteJmsTopics,
|
||||
final boolean autoCreateQueues,
|
||||
final boolean autoDeleteQueues,
|
||||
final boolean autoCreateAddresses,
|
||||
final boolean autoDeleteAddresses) throws Exception {
|
||||
checkStarted();
|
||||
|
||||
// JBPAPP-6334 requested this to be pageSizeBytes > maxSizeBytes
|
||||
|
@ -1770,6 +1829,12 @@ public class ActiveMQServerControlImpl extends AbstractControl implements Active
|
|||
}
|
||||
addressSettings.setAutoCreateJmsQueues(autoCreateJmsQueues);
|
||||
addressSettings.setAutoDeleteJmsQueues(autoDeleteJmsQueues);
|
||||
addressSettings.setAutoCreateJmsTopics(autoCreateJmsTopics);
|
||||
addressSettings.setAutoDeleteJmsTopics(autoDeleteJmsTopics);
|
||||
addressSettings.setAutoCreateQueues(autoCreateQueues);
|
||||
addressSettings.setAutoDeleteQueues(autoDeleteQueues);
|
||||
addressSettings.setAutoCreateAddresses(autoCreateAddresses);
|
||||
addressSettings.setAutoDeleteAddresses(autoDeleteAddresses);
|
||||
server.getAddressSettingsRepository().addMatch(address, addressSettings);
|
||||
|
||||
storageManager.storeAddressSetting(new PersistedAddressSetting(new SimpleString(address), addressSettings));
|
||||
|
|
|
@ -48,6 +48,8 @@ public class PersistedRoles implements EncodingSupport {
|
|||
|
||||
private SimpleString createAddressRoles;
|
||||
|
||||
private SimpleString deleteAddressRoles;
|
||||
|
||||
// Static --------------------------------------------------------
|
||||
|
||||
// Constructors --------------------------------------------------
|
||||
|
@ -65,6 +67,8 @@ public class PersistedRoles implements EncodingSupport {
|
|||
* @param deleteNonDurableQueueRoles
|
||||
* @param manageRoles
|
||||
* @param browseRoles
|
||||
* @param createAddressRoles
|
||||
* @param deleteAddressRoles
|
||||
*/
|
||||
public PersistedRoles(final String addressMatch,
|
||||
final String sendRoles,
|
||||
|
@ -75,7 +79,8 @@ public class PersistedRoles implements EncodingSupport {
|
|||
final String deleteNonDurableQueueRoles,
|
||||
final String manageRoles,
|
||||
final String browseRoles,
|
||||
final String createAddressRoles) {
|
||||
final String createAddressRoles,
|
||||
final String deleteAddressRoles) {
|
||||
super();
|
||||
this.addressMatch = SimpleString.toSimpleString(addressMatch);
|
||||
this.sendRoles = SimpleString.toSimpleString(sendRoles);
|
||||
|
@ -87,6 +92,7 @@ public class PersistedRoles implements EncodingSupport {
|
|||
this.manageRoles = SimpleString.toSimpleString(manageRoles);
|
||||
this.browseRoles = SimpleString.toSimpleString(browseRoles);
|
||||
this.createAddressRoles = SimpleString.toSimpleString(createAddressRoles);
|
||||
this.deleteAddressRoles = SimpleString.toSimpleString(deleteAddressRoles);
|
||||
}
|
||||
|
||||
// Public --------------------------------------------------------
|
||||
|
@ -169,6 +175,13 @@ public class PersistedRoles implements EncodingSupport {
|
|||
return createAddressRoles.toString();
|
||||
}
|
||||
|
||||
/**
|
||||
* @return the deleteAddressRoles
|
||||
*/
|
||||
public String getDeleteAddressRoles() {
|
||||
return deleteAddressRoles.toString();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void encode(final ActiveMQBuffer buffer) {
|
||||
buffer.writeSimpleString(addressMatch);
|
||||
|
@ -181,6 +194,7 @@ public class PersistedRoles implements EncodingSupport {
|
|||
buffer.writeNullableSimpleString(manageRoles);
|
||||
buffer.writeNullableSimpleString(browseRoles);
|
||||
buffer.writeNullableSimpleString(createAddressRoles);
|
||||
buffer.writeNullableSimpleString(deleteAddressRoles);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
@ -193,8 +207,8 @@ public class PersistedRoles implements EncodingSupport {
|
|||
SimpleString.sizeofNullableString(deleteNonDurableQueueRoles) +
|
||||
SimpleString.sizeofNullableString(manageRoles) +
|
||||
SimpleString.sizeofNullableString(browseRoles) +
|
||||
SimpleString.sizeofNullableString(createAddressRoles);
|
||||
|
||||
SimpleString.sizeofNullableString(createAddressRoles) +
|
||||
SimpleString.sizeofNullableString(deleteAddressRoles);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
@ -209,6 +223,7 @@ public class PersistedRoles implements EncodingSupport {
|
|||
manageRoles = buffer.readNullableSimpleString();
|
||||
browseRoles = buffer.readNullableSimpleString();
|
||||
createAddressRoles = buffer.readNullableSimpleString();
|
||||
deleteAddressRoles = buffer.readNullableSimpleString();
|
||||
}
|
||||
|
||||
/* (non-Javadoc)
|
||||
|
@ -227,6 +242,7 @@ public class PersistedRoles implements EncodingSupport {
|
|||
result = prime * result + ((manageRoles == null) ? 0 : manageRoles.hashCode());
|
||||
result = prime * result + ((browseRoles == null) ? 0 : browseRoles.hashCode());
|
||||
result = prime * result + ((createAddressRoles == null) ? 0 : createAddressRoles.hashCode());
|
||||
result = prime * result + ((deleteAddressRoles == null) ? 0 : deleteAddressRoles.hashCode());
|
||||
result = prime * result + ((sendRoles == null) ? 0 : sendRoles.hashCode());
|
||||
result = prime * result + (int) (storeId ^ (storeId >>> 32));
|
||||
return result;
|
||||
|
@ -289,6 +305,11 @@ public class PersistedRoles implements EncodingSupport {
|
|||
return false;
|
||||
} else if (!createAddressRoles.equals(other.createAddressRoles))
|
||||
return false;
|
||||
if (deleteAddressRoles == null) {
|
||||
if (other.deleteAddressRoles != null)
|
||||
return false;
|
||||
} else if (!deleteAddressRoles.equals(other.deleteAddressRoles))
|
||||
return false;
|
||||
if (sendRoles == null) {
|
||||
if (other.sendRoles != null)
|
||||
return false;
|
||||
|
@ -325,6 +346,8 @@ public class PersistedRoles implements EncodingSupport {
|
|||
browseRoles +
|
||||
", createAddressRoles=" +
|
||||
createAddressRoles +
|
||||
", deleteAddressRoles=" +
|
||||
deleteAddressRoles +
|
||||
"]";
|
||||
}
|
||||
|
||||
|
|
|
@ -1278,6 +1278,7 @@ public abstract class AbstractJournalStorageManager implements StorageManager {
|
|||
try {
|
||||
long recordID = idGenerator.generateID();
|
||||
bindingEncoding.setId(recordID);
|
||||
addressInfo.setId(recordID);
|
||||
bindingsJournal.appendAddRecordTransactional(tx, recordID, JournalRecordIds.ADDRESS_BINDING_RECORD, bindingEncoding);
|
||||
} finally {
|
||||
readUnLock();
|
||||
|
|
|
@ -132,7 +132,7 @@ public class PostOfficeImpl implements PostOffice, NotificationListener, Binding
|
|||
|
||||
private final ActiveMQServer server;
|
||||
|
||||
private Object addressLock = new Object();
|
||||
private final Object addressLock = new Object();
|
||||
|
||||
public PostOfficeImpl(final ActiveMQServer server,
|
||||
final StorageManager storageManager,
|
||||
|
@ -450,7 +450,7 @@ public class PostOfficeImpl implements PostOffice, NotificationListener, Binding
|
|||
synchronized (addressLock) {
|
||||
Bindings bindingsForAddress = getBindingsForAddress(address);
|
||||
if (bindingsForAddress.getBindings().size() > 0) {
|
||||
throw new IllegalStateException("Address has bindings");
|
||||
throw ActiveMQMessageBundle.BUNDLE.addressHasBindings(address);
|
||||
}
|
||||
managementService.unregisterAddress(address);
|
||||
return addressManager.removeAddressInfo(address);
|
||||
|
|
|
@ -32,6 +32,7 @@ import org.apache.activemq.artemis.core.protocol.core.impl.PacketImpl;
|
|||
import org.apache.activemq.artemis.core.protocol.core.impl.wireformat.ActiveMQExceptionMessage;
|
||||
import org.apache.activemq.artemis.core.protocol.core.impl.wireformat.CreateAddressMessage;
|
||||
import org.apache.activemq.artemis.core.protocol.core.impl.wireformat.CreateQueueMessage;
|
||||
import org.apache.activemq.artemis.core.protocol.core.impl.wireformat.CreateQueueMessage_V2;
|
||||
import org.apache.activemq.artemis.core.protocol.core.impl.wireformat.CreateSharedQueueMessage;
|
||||
import org.apache.activemq.artemis.core.protocol.core.impl.wireformat.NullResponseMessage;
|
||||
import org.apache.activemq.artemis.core.protocol.core.impl.wireformat.RollbackMessage;
|
||||
|
@ -85,6 +86,7 @@ import org.jboss.logging.Logger;
|
|||
|
||||
import static org.apache.activemq.artemis.core.protocol.core.impl.PacketImpl.CREATE_ADDRESS;
|
||||
import static org.apache.activemq.artemis.core.protocol.core.impl.PacketImpl.CREATE_QUEUE;
|
||||
import static org.apache.activemq.artemis.core.protocol.core.impl.PacketImpl.CREATE_QUEUE_V2;
|
||||
import static org.apache.activemq.artemis.core.protocol.core.impl.PacketImpl.CREATE_SHARED_QUEUE;
|
||||
import static org.apache.activemq.artemis.core.protocol.core.impl.PacketImpl.DELETE_QUEUE;
|
||||
import static org.apache.activemq.artemis.core.protocol.core.impl.PacketImpl.SESS_ACKNOWLEDGE;
|
||||
|
@ -225,7 +227,7 @@ public class ServerSessionPacketHandler implements ChannelHandler {
|
|||
case CREATE_ADDRESS: {
|
||||
CreateAddressMessage request = (CreateAddressMessage) packet;
|
||||
requiresResponse = request.isRequiresResponse();
|
||||
session.createAddress(request.getAddress(), request.isMulticast());
|
||||
session.createAddress(request.getAddress(), request.isMulticast(), request.isAutoCreated());
|
||||
if (requiresResponse) {
|
||||
response = new NullResponseMessage();
|
||||
}
|
||||
|
@ -240,6 +242,15 @@ public class ServerSessionPacketHandler implements ChannelHandler {
|
|||
}
|
||||
break;
|
||||
}
|
||||
case CREATE_QUEUE_V2: {
|
||||
CreateQueueMessage_V2 request = (CreateQueueMessage_V2) packet;
|
||||
requiresResponse = request.isRequiresResponse();
|
||||
session.createQueue(request.getAddress(), request.getQueueName(), request.getFilterString(), request.isTemporary(), request.isDurable(), null, null, request.isAutoCreated());
|
||||
if (requiresResponse) {
|
||||
response = new NullResponseMessage();
|
||||
}
|
||||
break;
|
||||
}
|
||||
case CREATE_SHARED_QUEUE: {
|
||||
CreateSharedQueueMessage request = (CreateSharedQueueMessage) packet;
|
||||
requiresResponse = request.isRequiresResponse();
|
||||
|
|
|
@ -22,7 +22,6 @@ import java.util.Set;
|
|||
import java.util.concurrent.ScheduledExecutorService;
|
||||
import java.util.concurrent.TimeUnit;
|
||||
|
||||
import com.google.common.collect.Queues;
|
||||
import org.apache.activemq.artemis.api.core.SimpleString;
|
||||
import org.apache.activemq.artemis.core.config.BridgeConfiguration;
|
||||
import org.apache.activemq.artemis.core.config.Configuration;
|
||||
|
|
|
@ -108,7 +108,7 @@ public interface ServerSession extends SecurityAuth {
|
|||
boolean temporary,
|
||||
boolean durable) throws Exception;
|
||||
|
||||
AddressInfo createAddress(final SimpleString address, final boolean multicast) throws Exception;
|
||||
AddressInfo createAddress(final SimpleString address, final boolean multicast, final boolean autoCreated) throws Exception;
|
||||
|
||||
void deleteQueue(SimpleString name) throws Exception;
|
||||
|
||||
|
|
|
@ -682,15 +682,14 @@ public class ActiveMQServerImpl implements ActiveMQServer {
|
|||
return postOffice.isAddressBound(SimpleString.toSimpleString(address));
|
||||
}
|
||||
|
||||
// TODO: this should probably look at the addresses too, not just queue bindings
|
||||
@Override
|
||||
public BindingQueryResult bindingQuery(SimpleString address) throws Exception {
|
||||
if (address == null) {
|
||||
throw ActiveMQMessageBundle.BUNDLE.addressIsNull();
|
||||
}
|
||||
|
||||
boolean autoCreateJmsQueues = getAddressSettingsRepository().getMatch(address.toString()).isAutoCreateJmsQueues();
|
||||
boolean autoCreateJmsTopics = getAddressSettingsRepository().getMatch(address.toString()).isAutoCreateJmsTopics();
|
||||
boolean autoCreateJmsQueues = getAddressSettingsRepository().getMatch(address.toString()).isAutoCreateQueues();
|
||||
boolean autoCreateJmsTopics = getAddressSettingsRepository().getMatch(address.toString()).isAutoCreateAddresses();
|
||||
|
||||
List<SimpleString> names = new ArrayList<>();
|
||||
|
||||
|
@ -710,7 +709,7 @@ public class ActiveMQServerImpl implements ActiveMQServer {
|
|||
}
|
||||
}
|
||||
|
||||
return new BindingQueryResult(!names.isEmpty(), names, autoCreateJmsQueues, autoCreateJmsTopics);
|
||||
return new BindingQueryResult(getAddressInfo(address) != null, names, autoCreateJmsQueues, autoCreateJmsTopics);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
@ -719,7 +718,7 @@ public class ActiveMQServerImpl implements ActiveMQServer {
|
|||
throw ActiveMQMessageBundle.BUNDLE.queueNameIsNull();
|
||||
}
|
||||
|
||||
boolean autoCreateJmsQueues = getAddressSettingsRepository().getMatch(name.toString()).isAutoCreateJmsQueues();
|
||||
boolean autoCreateJmsQueues = getAddressSettingsRepository().getMatch(name.toString()).isAutoCreateQueues();
|
||||
|
||||
QueueQueryResult response;
|
||||
|
||||
|
@ -1626,7 +1625,7 @@ public class ActiveMQServerImpl implements ActiveMQServer {
|
|||
public void destroyQueue(final SimpleString queueName,
|
||||
final SecurityAuth session,
|
||||
final boolean checkConsumerCount) throws Exception {
|
||||
destroyQueue(queueName, session, checkConsumerCount, false, true);
|
||||
destroyQueue(queueName, session, checkConsumerCount, false);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
@ -1678,7 +1677,7 @@ public class ActiveMQServerImpl implements ActiveMQServer {
|
|||
|
||||
if (autoDeleteAddress && postOffice != null) {
|
||||
try {
|
||||
postOffice.removeAddressInfo(address);
|
||||
removeAddressInfo(address);
|
||||
} catch (ActiveMQDeleteAddressException e) {
|
||||
// Could be thrown if the address has bindings or is not deletable.
|
||||
}
|
||||
|
@ -2319,7 +2318,7 @@ public class ActiveMQServerImpl implements ActiveMQServer {
|
|||
List<PersistedRoles> roles = storageManager.recoverPersistedRoles();
|
||||
|
||||
for (PersistedRoles roleItem : roles) {
|
||||
Set<Role> setRoles = SecurityFormatter.createSecurity(roleItem.getSendRoles(), roleItem.getConsumeRoles(), roleItem.getCreateDurableQueueRoles(), roleItem.getDeleteDurableQueueRoles(), roleItem.getCreateNonDurableQueueRoles(), roleItem.getDeleteNonDurableQueueRoles(), roleItem.getManageRoles(), roleItem.getBrowseRoles(), roleItem.getCreateAddressRoles());
|
||||
Set<Role> setRoles = SecurityFormatter.createSecurity(roleItem.getSendRoles(), roleItem.getConsumeRoles(), roleItem.getCreateDurableQueueRoles(), roleItem.getDeleteDurableQueueRoles(), roleItem.getCreateNonDurableQueueRoles(), roleItem.getDeleteNonDurableQueueRoles(), roleItem.getManageRoles(), roleItem.getBrowseRoles(), roleItem.getCreateAddressRoles(), roleItem.getDeleteAddressRoles());
|
||||
|
||||
securityRepository.addMatch(roleItem.getAddressMatch().toString(), setRoles);
|
||||
}
|
||||
|
@ -2358,15 +2357,15 @@ public class ActiveMQServerImpl implements ActiveMQServer {
|
|||
|
||||
@Override
|
||||
public void removeAddressInfo(SimpleString address) throws Exception {
|
||||
AddressInfo addressInfo = getAddressInfo(address);
|
||||
if (postOffice.removeAddressInfo(address) == null) {
|
||||
throw ActiveMQMessageBundle.BUNDLE.addressDoesNotExist(address);
|
||||
};
|
||||
|
||||
// TODO: is this the right way to do this?
|
||||
// long txID = storageManager.generateID();
|
||||
// storageManager.deleteAddressBinding(txID, getAddressInfo(address).getID());
|
||||
// storageManager.commitBindings(txID);
|
||||
}
|
||||
|
||||
// TODO: is this the right way to do this? Should it use a transaction?
|
||||
long txID = storageManager.generateID();
|
||||
storageManager.deleteAddressBinding(txID, addressInfo.getId());
|
||||
storageManager.commitBindings(txID);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
|
|
@ -21,6 +21,8 @@ import org.apache.activemq.artemis.api.core.SimpleString;
|
|||
|
||||
public class AddressInfo {
|
||||
|
||||
private long id;
|
||||
|
||||
private final SimpleString name;
|
||||
|
||||
private RoutingType routingType = RoutingType.MULTICAST;
|
||||
|
@ -84,10 +86,19 @@ public class AddressInfo {
|
|||
return name;
|
||||
}
|
||||
|
||||
public void setId(long id) {
|
||||
this.id = id;
|
||||
}
|
||||
|
||||
public long getId() {
|
||||
return id;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
StringBuffer buff = new StringBuffer();
|
||||
buff.append("Address [name=" + name);
|
||||
buff.append(", id=" + id);
|
||||
buff.append(", routingType=" + routingType);
|
||||
buff.append(", defaultMaxQueueConsumers=" + defaultMaxQueueConsumers);
|
||||
buff.append(", defaultDeleteOnNoConsumers=" + defaultDeleteOnNoConsumers);
|
||||
|
|
|
@ -39,17 +39,15 @@ public class AutoCreatedQueueManagerImpl implements AutoCreatedQueueManager {
|
|||
long consumerCount = queue.getConsumerCount();
|
||||
long messageCount = queue.getMessageCount();
|
||||
|
||||
// TODO make sure this is the right check
|
||||
if ((queue.isAutoCreated() || queue.isDeleteOnNoConsumers()) && queue.getMessageCount() == 0) {
|
||||
if (((queue.isAutoCreated() && settings.isAutoDeleteQueues()) || queue.isDeleteOnNoConsumers()) && queue.getMessageCount() == 0) {
|
||||
if (ActiveMQServerLogger.LOGGER.isDebugEnabled()) {
|
||||
ActiveMQServerLogger.LOGGER.debug("deleting auto-created queue \"" + queueName + ".\" consumerCount = " + consumerCount + "; messageCount = " + messageCount + "; getAutoDeleteJmsQueues = " + settings.getAutoDeleteJmsQueues());
|
||||
ActiveMQServerLogger.LOGGER.debug("deleting " + (queue.isAutoCreated() ? "auto-created " : "") + "queue \"" + queueName + ".\" consumerCount = " + consumerCount + "; messageCount = " + messageCount + "; isAutoDeleteQueues = " + settings.isAutoDeleteQueues());
|
||||
}
|
||||
|
||||
// TODO handle this exception better
|
||||
try {
|
||||
server.destroyQueue(queueName, null, true, false);
|
||||
} catch (Exception e) {
|
||||
e.printStackTrace();
|
||||
ActiveMQServerLogger.LOGGER.errorRemovingAutoCreatedQueue(e, queueName);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -367,7 +367,7 @@ public class QueueImpl implements Queue {
|
|||
|
||||
this.address = address;
|
||||
|
||||
this.addressInfo = postOffice.getAddressInfo(address);
|
||||
this.addressInfo = postOffice == null ? null : postOffice.getAddressInfo(address);
|
||||
|
||||
this.name = name;
|
||||
|
||||
|
|
|
@ -510,7 +510,7 @@ public class ServerSessionImpl implements ServerSession, FailureListener {
|
|||
|
||||
server.checkQueueCreationLimit(getUsername());
|
||||
|
||||
Queue queue = server.createQueue(address, name, filterString, SimpleString.toSimpleString(getUsername()), durable, temporary, maxConsumers, deleteOnNoConsumers, true);
|
||||
Queue queue = server.createQueue(address, name, filterString, SimpleString.toSimpleString(getUsername()), durable, temporary, autoCreated, maxConsumers, deleteOnNoConsumers, true);
|
||||
|
||||
if (temporary) {
|
||||
// Temporary queue in core simply means the queue will be deleted if
|
||||
|
@ -541,12 +541,11 @@ public class ServerSessionImpl implements ServerSession, FailureListener {
|
|||
}
|
||||
|
||||
@Override
|
||||
public AddressInfo createAddress(final SimpleString address, final boolean multicast) throws Exception {
|
||||
// make sure the user has privileges to create this queue
|
||||
public AddressInfo createAddress(final SimpleString address, final boolean multicast, final boolean autoCreated) throws Exception {
|
||||
securityCheck(address, CheckType.CREATE_ADDRESS, this);
|
||||
AddressInfo.RoutingType routingType = multicast ? AddressInfo.RoutingType.MULTICAST : AddressInfo.RoutingType.ANYCAST;
|
||||
|
||||
AddressInfo addressInfo = server.createOrUpdateAddressInfo(new AddressInfo(address).setRoutingType(routingType));
|
||||
AddressInfo addressInfo = server.createOrUpdateAddressInfo(new AddressInfo(address).setRoutingType(routingType).setAutoCreated(autoCreated));
|
||||
|
||||
return addressInfo;
|
||||
}
|
||||
|
|
|
@ -52,14 +52,26 @@ public class AddressSettings implements Mergeable<AddressSettings>, Serializable
|
|||
|
||||
public static final boolean DEFAULT_LAST_VALUE_QUEUE = false;
|
||||
|
||||
@Deprecated
|
||||
public static final boolean DEFAULT_AUTO_CREATE_JMS_QUEUES = true;
|
||||
|
||||
@Deprecated
|
||||
public static final boolean DEFAULT_AUTO_DELETE_JMS_QUEUES = true;
|
||||
|
||||
@Deprecated
|
||||
public static final boolean DEFAULT_AUTO_CREATE_TOPICS = true;
|
||||
|
||||
@Deprecated
|
||||
public static final boolean DEFAULT_AUTO_DELETE_TOPICS = true;
|
||||
|
||||
public static final boolean DEFAULT_AUTO_CREATE_QUEUES = true;
|
||||
|
||||
public static final boolean DEFAULT_AUTO_DELETE_QUEUES = true;
|
||||
|
||||
public static final boolean DEFAULT_AUTO_CREATE_ADDRESSES = true;
|
||||
|
||||
public static final boolean DEFAULT_AUTO_DELETE_ADDRESSES = true;
|
||||
|
||||
public static final long DEFAULT_REDISTRIBUTION_DELAY = -1;
|
||||
|
||||
public static final long DEFAULT_EXPIRY_DELAY = -1;
|
||||
|
@ -125,6 +137,14 @@ public class AddressSettings implements Mergeable<AddressSettings>, Serializable
|
|||
|
||||
private Boolean autoDeleteJmsTopics = null;
|
||||
|
||||
private Boolean autoCreateQueues = null;
|
||||
|
||||
private Boolean autoDeleteQueues = null;
|
||||
|
||||
private Boolean autoCreateAddresses = null;
|
||||
|
||||
private Boolean autoDeleteAddresses = null;
|
||||
|
||||
private Integer managementBrowsePageSize = AddressSettings.MANAGEMENT_BROWSE_PAGE_SIZE;
|
||||
|
||||
private Long maxSizeBytesRejectThreshold = null;
|
||||
|
@ -157,6 +177,10 @@ public class AddressSettings implements Mergeable<AddressSettings>, Serializable
|
|||
this.autoDeleteJmsQueues = other.autoDeleteJmsQueues;
|
||||
this.autoCreateJmsTopics = other.autoCreateJmsTopics;
|
||||
this.autoDeleteJmsTopics = other.autoDeleteJmsTopics;
|
||||
this.autoCreateQueues = other.autoCreateQueues;
|
||||
this.autoDeleteQueues = other.autoDeleteQueues;
|
||||
this.autoCreateAddresses = other.autoCreateAddresses;
|
||||
this.autoDeleteAddresses = other.autoDeleteAddresses;
|
||||
this.managementBrowsePageSize = other.managementBrowsePageSize;
|
||||
this.queuePrefetch = other.queuePrefetch;
|
||||
this.maxSizeBytesRejectThreshold = other.maxSizeBytesRejectThreshold;
|
||||
|
@ -165,42 +189,86 @@ public class AddressSettings implements Mergeable<AddressSettings>, Serializable
|
|||
public AddressSettings() {
|
||||
}
|
||||
|
||||
@Deprecated
|
||||
public boolean isAutoCreateJmsQueues() {
|
||||
return autoCreateJmsQueues != null ? autoCreateJmsQueues : AddressSettings.DEFAULT_AUTO_CREATE_JMS_QUEUES;
|
||||
}
|
||||
|
||||
@Deprecated
|
||||
public AddressSettings setAutoCreateJmsQueues(final boolean autoCreateJmsQueues) {
|
||||
this.autoCreateJmsQueues = autoCreateJmsQueues;
|
||||
return this;
|
||||
}
|
||||
|
||||
public boolean getAutoDeleteJmsQueues() {
|
||||
@Deprecated
|
||||
public boolean isAutoDeleteJmsQueues() {
|
||||
return autoDeleteJmsQueues != null ? autoDeleteJmsQueues : AddressSettings.DEFAULT_AUTO_DELETE_JMS_QUEUES;
|
||||
}
|
||||
|
||||
@Deprecated
|
||||
public AddressSettings setAutoDeleteJmsQueues(final boolean autoDeleteJmsQueues) {
|
||||
this.autoDeleteJmsQueues = autoDeleteJmsQueues;
|
||||
return this;
|
||||
}
|
||||
|
||||
@Deprecated
|
||||
public boolean isAutoCreateJmsTopics() {
|
||||
return autoCreateJmsTopics != null ? autoCreateJmsTopics : AddressSettings.DEFAULT_AUTO_CREATE_TOPICS;
|
||||
}
|
||||
|
||||
@Deprecated
|
||||
public AddressSettings setAutoCreateJmsTopics(final boolean autoCreateJmsTopics) {
|
||||
this.autoCreateJmsTopics = autoCreateJmsTopics;
|
||||
return this;
|
||||
}
|
||||
|
||||
@Deprecated
|
||||
public boolean isAutoDeleteJmsTopics() {
|
||||
return autoDeleteJmsTopics != null ? autoDeleteJmsTopics : AddressSettings.DEFAULT_AUTO_DELETE_TOPICS;
|
||||
}
|
||||
|
||||
@Deprecated
|
||||
public AddressSettings setAutoDeleteJmsTopics(final boolean autoDeleteJmsTopics) {
|
||||
this.autoDeleteJmsTopics = autoDeleteJmsTopics;
|
||||
return this;
|
||||
}
|
||||
|
||||
public boolean isAutoCreateQueues() {
|
||||
return autoCreateQueues != null ? autoCreateQueues : AddressSettings.DEFAULT_AUTO_CREATE_QUEUES;
|
||||
}
|
||||
|
||||
public AddressSettings setAutoCreateQueues(Boolean autoCreateQueues) {
|
||||
this.autoCreateQueues = autoCreateQueues;
|
||||
return this;
|
||||
}
|
||||
|
||||
public boolean isAutoDeleteQueues() {
|
||||
return autoDeleteQueues != null ? autoDeleteQueues : AddressSettings.DEFAULT_AUTO_DELETE_QUEUES;
|
||||
}
|
||||
|
||||
public AddressSettings setAutoDeleteQueues(Boolean autoDeleteQueues) {
|
||||
this.autoDeleteQueues = autoDeleteQueues;
|
||||
return this;
|
||||
}
|
||||
|
||||
public boolean isAutoCreateAddresses() {
|
||||
return autoCreateAddresses != null ? autoCreateAddresses : AddressSettings.DEFAULT_AUTO_CREATE_ADDRESSES;
|
||||
}
|
||||
|
||||
public AddressSettings setAutoCreateAddresses(Boolean autoCreateAddresses) {
|
||||
this.autoCreateAddresses = autoCreateAddresses;
|
||||
return this;
|
||||
}
|
||||
|
||||
public boolean isAutoDeleteAddresses() {
|
||||
return autoDeleteAddresses != null ? autoDeleteAddresses : AddressSettings.DEFAULT_AUTO_DELETE_ADDRESSES;
|
||||
}
|
||||
|
||||
public AddressSettings setAutoDeleteAddresses(Boolean autoDeleteAddresses) {
|
||||
this.autoDeleteAddresses = autoDeleteAddresses;
|
||||
return this;
|
||||
}
|
||||
|
||||
public boolean isLastValueQueue() {
|
||||
return lastValueQueue != null ? lastValueQueue : AddressSettings.DEFAULT_LAST_VALUE_QUEUE;
|
||||
}
|
||||
|
@ -459,12 +527,24 @@ public class AddressSettings implements Mergeable<AddressSettings>, Serializable
|
|||
if (autoDeleteJmsQueues == null) {
|
||||
autoDeleteJmsQueues = merged.autoDeleteJmsQueues;
|
||||
}
|
||||
// if (autoCreateJmsTopics == null) {
|
||||
// autoCreateJmsTopics = merged.autoCreateJmsTopics;
|
||||
// }
|
||||
if (autoCreateJmsTopics == null) {
|
||||
autoCreateJmsTopics = merged.autoCreateJmsTopics;
|
||||
}
|
||||
if (autoDeleteJmsTopics == null) {
|
||||
autoDeleteJmsTopics = merged.autoDeleteJmsTopics;
|
||||
}
|
||||
if (autoCreateQueues == null) {
|
||||
autoCreateQueues = merged.autoCreateQueues;
|
||||
}
|
||||
if (autoDeleteQueues == null) {
|
||||
autoDeleteQueues = merged.autoDeleteQueues;
|
||||
}
|
||||
if (autoCreateAddresses == null) {
|
||||
autoCreateAddresses = merged.autoCreateAddresses;
|
||||
}
|
||||
if (autoDeleteAddresses == null) {
|
||||
autoDeleteAddresses = merged.autoDeleteAddresses;
|
||||
}
|
||||
if (managementBrowsePageSize == null) {
|
||||
managementBrowsePageSize = merged.managementBrowsePageSize;
|
||||
}
|
||||
|
@ -532,10 +612,18 @@ public class AddressSettings implements Mergeable<AddressSettings>, Serializable
|
|||
|
||||
autoDeleteJmsQueues = BufferHelper.readNullableBoolean(buffer);
|
||||
|
||||
// autoCreateJmsTopics = BufferHelper.readNullableBoolean(buffer);
|
||||
autoCreateJmsTopics = BufferHelper.readNullableBoolean(buffer);
|
||||
|
||||
autoDeleteJmsTopics = BufferHelper.readNullableBoolean(buffer);
|
||||
|
||||
autoCreateQueues = BufferHelper.readNullableBoolean(buffer);
|
||||
|
||||
autoDeleteQueues = BufferHelper.readNullableBoolean(buffer);
|
||||
|
||||
autoCreateAddresses = BufferHelper.readNullableBoolean(buffer);
|
||||
|
||||
autoDeleteAddresses = BufferHelper.readNullableBoolean(buffer);
|
||||
|
||||
managementBrowsePageSize = BufferHelper.readNullableInteger(buffer);
|
||||
|
||||
maxSizeBytesRejectThreshold = BufferHelper.readNullableLong(buffer);
|
||||
|
@ -565,8 +653,12 @@ public class AddressSettings implements Mergeable<AddressSettings>, Serializable
|
|||
BufferHelper.sizeOfNullableSimpleString(slowConsumerPolicy != null ? slowConsumerPolicy.toString() : null) +
|
||||
BufferHelper.sizeOfNullableBoolean(autoCreateJmsQueues) +
|
||||
BufferHelper.sizeOfNullableBoolean(autoDeleteJmsQueues) +
|
||||
// BufferHelper.sizeOfNullableBoolean(autoCreateJmsTopics) +
|
||||
BufferHelper.sizeOfNullableBoolean(autoCreateJmsTopics) +
|
||||
BufferHelper.sizeOfNullableBoolean(autoDeleteJmsTopics) +
|
||||
BufferHelper.sizeOfNullableBoolean(autoCreateQueues) +
|
||||
BufferHelper.sizeOfNullableBoolean(autoDeleteQueues) +
|
||||
BufferHelper.sizeOfNullableBoolean(autoCreateAddresses) +
|
||||
BufferHelper.sizeOfNullableBoolean(autoDeleteAddresses) +
|
||||
BufferHelper.sizeOfNullableInteger(managementBrowsePageSize) +
|
||||
BufferHelper.sizeOfNullableLong(maxSizeBytesRejectThreshold);
|
||||
}
|
||||
|
@ -615,10 +707,18 @@ public class AddressSettings implements Mergeable<AddressSettings>, Serializable
|
|||
|
||||
BufferHelper.writeNullableBoolean(buffer, autoDeleteJmsQueues);
|
||||
|
||||
// BufferHelper.writeNullableBoolean(buffer, autoCreateJmsTopics);
|
||||
BufferHelper.writeNullableBoolean(buffer, autoCreateJmsTopics);
|
||||
|
||||
BufferHelper.writeNullableBoolean(buffer, autoDeleteJmsTopics);
|
||||
|
||||
BufferHelper.writeNullableBoolean(buffer, autoCreateQueues);
|
||||
|
||||
BufferHelper.writeNullableBoolean(buffer, autoDeleteQueues);
|
||||
|
||||
BufferHelper.writeNullableBoolean(buffer, autoCreateAddresses);
|
||||
|
||||
BufferHelper.writeNullableBoolean(buffer, autoDeleteAddresses);
|
||||
|
||||
BufferHelper.writeNullableInteger(buffer, managementBrowsePageSize);
|
||||
|
||||
BufferHelper.writeNullableLong(buffer, maxSizeBytesRejectThreshold);
|
||||
|
@ -652,8 +752,12 @@ public class AddressSettings implements Mergeable<AddressSettings>, Serializable
|
|||
result = prime * result + ((slowConsumerPolicy == null) ? 0 : slowConsumerPolicy.hashCode());
|
||||
result = prime * result + ((autoCreateJmsQueues == null) ? 0 : autoCreateJmsQueues.hashCode());
|
||||
result = prime * result + ((autoDeleteJmsQueues == null) ? 0 : autoDeleteJmsQueues.hashCode());
|
||||
// result = prime * result + ((autoCreateJmsTopics == null) ? 0 : autoCreateJmsTopics.hashCode());
|
||||
result = prime * result + ((autoCreateJmsTopics == null) ? 0 : autoCreateJmsTopics.hashCode());
|
||||
result = prime * result + ((autoDeleteJmsTopics == null) ? 0 : autoDeleteJmsTopics.hashCode());
|
||||
result = prime * result + ((autoCreateQueues == null) ? 0 : autoCreateQueues.hashCode());
|
||||
result = prime * result + ((autoDeleteQueues == null) ? 0 : autoDeleteQueues.hashCode());
|
||||
result = prime * result + ((autoCreateAddresses == null) ? 0 : autoCreateAddresses.hashCode());
|
||||
result = prime * result + ((autoDeleteAddresses == null) ? 0 : autoDeleteAddresses.hashCode());
|
||||
result = prime * result + ((managementBrowsePageSize == null) ? 0 : managementBrowsePageSize.hashCode());
|
||||
result = prime * result + ((queuePrefetch == null) ? 0 : queuePrefetch.hashCode());
|
||||
result = prime * result + ((maxSizeBytesRejectThreshold == null) ? 0 : queuePrefetch.hashCode());
|
||||
|
@ -777,18 +881,36 @@ public class AddressSettings implements Mergeable<AddressSettings>, Serializable
|
|||
return false;
|
||||
} else if (!autoDeleteJmsQueues.equals(other.autoDeleteJmsQueues))
|
||||
return false;
|
||||
|
||||
// if (autoCreateJmsTopics == null) {
|
||||
// if (other.autoCreateJmsTopics != null)
|
||||
// return false;
|
||||
// } else if (!autoCreateJmsTopics.equals(other.autoCreateJmsTopics))
|
||||
// return false;
|
||||
if (autoCreateJmsTopics == null) {
|
||||
if (other.autoCreateJmsTopics != null)
|
||||
return false;
|
||||
} else if (!autoCreateJmsTopics.equals(other.autoCreateJmsTopics))
|
||||
return false;
|
||||
if (autoDeleteJmsTopics == null) {
|
||||
if (other.autoDeleteJmsTopics != null)
|
||||
return false;
|
||||
} else if (!autoDeleteJmsTopics.equals(other.autoDeleteJmsTopics))
|
||||
return false;
|
||||
|
||||
if (autoCreateQueues == null) {
|
||||
if (other.autoCreateQueues != null)
|
||||
return false;
|
||||
} else if (!autoCreateQueues.equals(other.autoCreateQueues))
|
||||
return false;
|
||||
if (autoDeleteQueues == null) {
|
||||
if (other.autoDeleteQueues != null)
|
||||
return false;
|
||||
} else if (!autoDeleteQueues.equals(other.autoDeleteQueues))
|
||||
return false;
|
||||
if (autoCreateAddresses == null) {
|
||||
if (other.autoCreateAddresses != null)
|
||||
return false;
|
||||
} else if (!autoCreateAddresses.equals(other.autoCreateAddresses))
|
||||
return false;
|
||||
if (autoDeleteAddresses == null) {
|
||||
if (other.autoDeleteAddresses != null)
|
||||
return false;
|
||||
} else if (!autoDeleteAddresses.equals(other.autoDeleteAddresses))
|
||||
return false;
|
||||
if (managementBrowsePageSize == null) {
|
||||
if (other.managementBrowsePageSize != null)
|
||||
return false;
|
||||
|
@ -854,11 +976,20 @@ public class AddressSettings implements Mergeable<AddressSettings>, Serializable
|
|||
slowConsumerPolicy +
|
||||
", autoCreateJmsQueues=" +
|
||||
autoCreateJmsQueues +
|
||||
", autoDeleteJmsQueues=" + autoDeleteJmsQueues +
|
||||
", autoDeleteJmsQueues=" +
|
||||
autoDeleteJmsQueues +
|
||||
", autoCreateJmsTopics=" +
|
||||
// autoCreateJmsTopics +
|
||||
// ", autoDeleteJmsTopics=" +
|
||||
autoCreateJmsTopics +
|
||||
", autoDeleteJmsTopics=" +
|
||||
autoDeleteJmsTopics +
|
||||
", autoCreateQueues=" +
|
||||
autoCreateQueues +
|
||||
", autoDeleteQueues=" +
|
||||
autoDeleteQueues +
|
||||
", autoCreateAddresses=" +
|
||||
autoCreateAddresses +
|
||||
", autoDeleteAddresses=" +
|
||||
autoDeleteAddresses +
|
||||
", managementBrowsePageSize=" +
|
||||
managementBrowsePageSize +
|
||||
"]";
|
||||
|
|
|
@ -2407,7 +2407,7 @@
|
|||
<xsd:element name="auto-create-jms-queues" type="xsd:boolean" default="true" maxOccurs="1" minOccurs="0">
|
||||
<xsd:annotation>
|
||||
<xsd:documentation>
|
||||
whether or not to automatically create JMS queues when a producer sends or a consumer connects to a
|
||||
DEPRECATED: whether or not to automatically create JMS queues when a producer sends or a consumer connects to a
|
||||
queue
|
||||
</xsd:documentation>
|
||||
</xsd:annotation>
|
||||
|
@ -2416,7 +2416,7 @@
|
|||
<xsd:element name="auto-delete-jms-queues" type="xsd:boolean" default="true" maxOccurs="1" minOccurs="0">
|
||||
<xsd:annotation>
|
||||
<xsd:documentation>
|
||||
whether or not to delete auto-created JMS queues when the queue has 0 consumers and 0 messages
|
||||
DEPRECATED: whether or not to delete auto-created JMS queues when the queue has 0 consumers and 0 messages
|
||||
</xsd:documentation>
|
||||
</xsd:annotation>
|
||||
</xsd:element>
|
||||
|
@ -2424,7 +2424,7 @@
|
|||
<xsd:element name="auto-create-jms-topics" type="xsd:boolean" default="true" maxOccurs="1" minOccurs="0">
|
||||
<xsd:annotation>
|
||||
<xsd:documentation>
|
||||
whether or not to automatically create JMS topics when a producer sends or a consumer subscribes to
|
||||
DEPRECATED: whether or not to automatically create JMS topics when a producer sends or a consumer subscribes to
|
||||
a topic
|
||||
</xsd:documentation>
|
||||
</xsd:annotation>
|
||||
|
@ -2433,7 +2433,42 @@
|
|||
<xsd:element name="auto-delete-jms-topics" type="xsd:boolean" default="true" maxOccurs="1" minOccurs="0">
|
||||
<xsd:annotation>
|
||||
<xsd:documentation>
|
||||
whether or not to delete auto-created JMS topics when the last subscription is closed
|
||||
DEPRECATED: whether or not to delete auto-created JMS topics when the last subscription is closed
|
||||
</xsd:documentation>
|
||||
</xsd:annotation>
|
||||
</xsd:element>
|
||||
|
||||
<xsd:element name="auto-create-queues" type="xsd:boolean" default="true" maxOccurs="1" minOccurs="0">
|
||||
<xsd:annotation>
|
||||
<xsd:documentation>
|
||||
whether or not to automatically create a queue when a client sends a message to or attempts to consume
|
||||
a message from a queue
|
||||
</xsd:documentation>
|
||||
</xsd:annotation>
|
||||
</xsd:element>
|
||||
|
||||
<xsd:element name="auto-delete-queues" type="xsd:boolean" default="true" maxOccurs="1" minOccurs="0">
|
||||
<xsd:annotation>
|
||||
<xsd:documentation>
|
||||
whether or not to delete auto-created queues when the queue has 0 consumers and 0 messages
|
||||
</xsd:documentation>
|
||||
</xsd:annotation>
|
||||
</xsd:element>
|
||||
|
||||
<xsd:element name="auto-create-addresses" type="xsd:boolean" default="true" maxOccurs="1" minOccurs="0">
|
||||
<xsd:annotation>
|
||||
<xsd:documentation>
|
||||
whether or not to automatically create addresses when a client sends a message to or attempts to
|
||||
consume a message from a queue mapped to an address that doesn't exist
|
||||
a queue
|
||||
</xsd:documentation>
|
||||
</xsd:annotation>
|
||||
</xsd:element>
|
||||
|
||||
<xsd:element name="auto-delete-addresses" type="xsd:boolean" default="true" maxOccurs="1" minOccurs="0">
|
||||
<xsd:annotation>
|
||||
<xsd:documentation>
|
||||
whether or not to delete auto-created addresses when it no longer has any queues
|
||||
</xsd:documentation>
|
||||
</xsd:annotation>
|
||||
</xsd:element>
|
||||
|
|
|
@ -301,7 +301,7 @@ public class FileConfigurationTest extends ConfigurationImplTest {
|
|||
assertEquals(5, conf.getAddressesSettings().get("a1").getSlowConsumerCheckPeriod());
|
||||
assertEquals(SlowConsumerPolicy.NOTIFY, conf.getAddressesSettings().get("a1").getSlowConsumerPolicy());
|
||||
assertEquals(true, conf.getAddressesSettings().get("a1").isAutoCreateJmsQueues());
|
||||
assertEquals(true, conf.getAddressesSettings().get("a1").getAutoDeleteJmsQueues());
|
||||
assertEquals(true, conf.getAddressesSettings().get("a1").isAutoDeleteJmsQueues());
|
||||
assertEquals(true, conf.getAddressesSettings().get("a1").isAutoCreateJmsTopics());
|
||||
assertEquals(true, conf.getAddressesSettings().get("a1").isAutoDeleteJmsTopics());
|
||||
|
||||
|
@ -316,7 +316,7 @@ public class FileConfigurationTest extends ConfigurationImplTest {
|
|||
assertEquals(15, conf.getAddressesSettings().get("a2").getSlowConsumerCheckPeriod());
|
||||
assertEquals(SlowConsumerPolicy.KILL, conf.getAddressesSettings().get("a2").getSlowConsumerPolicy());
|
||||
assertEquals(false, conf.getAddressesSettings().get("a2").isAutoCreateJmsQueues());
|
||||
assertEquals(false, conf.getAddressesSettings().get("a2").getAutoDeleteJmsQueues());
|
||||
assertEquals(false, conf.getAddressesSettings().get("a2").isAutoDeleteJmsQueues());
|
||||
assertEquals(false, conf.getAddressesSettings().get("a2").isAutoCreateJmsTopics());
|
||||
assertEquals(false, conf.getAddressesSettings().get("a2").isAutoDeleteJmsTopics());
|
||||
|
||||
|
|
|
@ -42,7 +42,7 @@ public class RoleTest extends Assert {
|
|||
|
||||
@Test
|
||||
public void testWriteRole() throws Exception {
|
||||
Role role = new Role("testWriteRole", true, false, false, false, false, false, false, false, false);
|
||||
Role role = new Role("testWriteRole", true, false, false, false, false, false, false, false, false, false);
|
||||
Assert.assertTrue(SEND.hasRole(role));
|
||||
Assert.assertFalse(CONSUME.hasRole(role));
|
||||
Assert.assertFalse(CREATE_DURABLE_QUEUE.hasRole(role));
|
||||
|
@ -56,7 +56,7 @@ public class RoleTest extends Assert {
|
|||
|
||||
@Test
|
||||
public void testReadRole() throws Exception {
|
||||
Role role = new Role("testReadRole", false, true, false, false, false, false, false, true, false);
|
||||
Role role = new Role("testReadRole", false, true, false, false, false, false, false, true, false, false);
|
||||
Assert.assertFalse(SEND.hasRole(role));
|
||||
Assert.assertTrue(CONSUME.hasRole(role));
|
||||
Assert.assertFalse(CREATE_DURABLE_QUEUE.hasRole(role));
|
||||
|
@ -70,7 +70,7 @@ public class RoleTest extends Assert {
|
|||
|
||||
@Test
|
||||
public void testCreateRole() throws Exception {
|
||||
Role role = new Role("testCreateRole", false, false, true, false, false, false, false, false, false);
|
||||
Role role = new Role("testCreateRole", false, false, true, false, false, false, false, false, false, false);
|
||||
Assert.assertFalse(SEND.hasRole(role));
|
||||
Assert.assertFalse(CONSUME.hasRole(role));
|
||||
Assert.assertTrue(CREATE_DURABLE_QUEUE.hasRole(role));
|
||||
|
@ -84,7 +84,7 @@ public class RoleTest extends Assert {
|
|||
|
||||
@Test
|
||||
public void testManageRole() throws Exception {
|
||||
Role role = new Role("testManageRole", false, false, false, false, false, false, true, false, false);
|
||||
Role role = new Role("testManageRole", false, false, false, false, false, false, true, false, false, false);
|
||||
Assert.assertFalse(SEND.hasRole(role));
|
||||
Assert.assertFalse(CONSUME.hasRole(role));
|
||||
Assert.assertFalse(CREATE_DURABLE_QUEUE.hasRole(role));
|
||||
|
@ -98,12 +98,12 @@ public class RoleTest extends Assert {
|
|||
|
||||
@Test
|
||||
public void testEqualsAndHashcode() throws Exception {
|
||||
Role role = new Role("testEquals", true, true, true, false, false, false, false, false, false);
|
||||
Role sameRole = new Role("testEquals", true, true, true, false, false, false, false, false, false);
|
||||
Role roleWithDifferentName = new Role("notEquals", true, true, true, false, false, false, false, false, false);
|
||||
Role roleWithDifferentRead = new Role("testEquals", false, true, true, false, false, false, false, false, false);
|
||||
Role roleWithDifferentWrite = new Role("testEquals", true, false, true, false, false, false, false, false, false);
|
||||
Role roleWithDifferentCreate = new Role("testEquals", true, true, false, false, false, false, false, false, false);
|
||||
Role role = new Role("testEquals", true, true, true, false, false, false, false, false, false, false);
|
||||
Role sameRole = new Role("testEquals", true, true, true, false, false, false, false, false, false, false);
|
||||
Role roleWithDifferentName = new Role("notEquals", true, true, true, false, false, false, false, false, false, false);
|
||||
Role roleWithDifferentRead = new Role("testEquals", false, true, true, false, false, false, false, false, false, false);
|
||||
Role roleWithDifferentWrite = new Role("testEquals", true, false, true, false, false, false, false, false, false, false);
|
||||
Role roleWithDifferentCreate = new Role("testEquals", true, true, false, false, false, false, false, false, false, false);
|
||||
|
||||
Assert.assertTrue(role.equals(role));
|
||||
|
||||
|
|
|
@ -40,9 +40,13 @@ public class AddressSettingsTest extends ActiveMQTestBase {
|
|||
Assert.assertEquals(AddressSettings.DEFAULT_SLOW_CONSUMER_CHECK_PERIOD, addressSettings.getSlowConsumerCheckPeriod());
|
||||
Assert.assertEquals(AddressSettings.DEFAULT_SLOW_CONSUMER_POLICY, addressSettings.getSlowConsumerPolicy());
|
||||
Assert.assertEquals(AddressSettings.DEFAULT_AUTO_CREATE_JMS_QUEUES, addressSettings.isAutoCreateJmsQueues());
|
||||
Assert.assertEquals(AddressSettings.DEFAULT_AUTO_DELETE_JMS_QUEUES, addressSettings.getAutoDeleteJmsQueues());
|
||||
// Assert.assertEquals(AddressSettings.DEFAULT_AUTO_CREATE_TOPICS, addressSettings.isAutoCreateJmsTopics());
|
||||
// Assert.assertEquals(AddressSettings.DEFAULT_AUTO_DELETE_TOPICS, addressSettings.isAutoDeleteJmsTopics());
|
||||
Assert.assertEquals(AddressSettings.DEFAULT_AUTO_DELETE_JMS_QUEUES, addressSettings.isAutoDeleteJmsQueues());
|
||||
Assert.assertEquals(AddressSettings.DEFAULT_AUTO_CREATE_TOPICS, addressSettings.isAutoCreateJmsTopics());
|
||||
Assert.assertEquals(AddressSettings.DEFAULT_AUTO_DELETE_TOPICS, addressSettings.isAutoDeleteJmsTopics());
|
||||
Assert.assertEquals(AddressSettings.DEFAULT_AUTO_CREATE_QUEUES, addressSettings.isAutoCreateQueues());
|
||||
Assert.assertEquals(AddressSettings.DEFAULT_AUTO_DELETE_QUEUES, addressSettings.isAutoDeleteQueues());
|
||||
Assert.assertEquals(AddressSettings.DEFAULT_AUTO_CREATE_ADDRESSES, addressSettings.isAutoCreateAddresses());
|
||||
Assert.assertEquals(AddressSettings.DEFAULT_AUTO_DELETE_ADDRESSES, addressSettings.isAutoDeleteAddresses());
|
||||
}
|
||||
|
||||
@Test
|
||||
|
|
|
@ -72,13 +72,13 @@ public class RepositoryTest extends ActiveMQTestBase {
|
|||
public void testSingletwo() {
|
||||
securityRepository.addMatch("queues.another.aq.*", new HashSet<Role>());
|
||||
HashSet<Role> roles = new HashSet<>(2);
|
||||
roles.add(new Role("test1", true, true, true, true, true, true, true, true, true));
|
||||
roles.add(new Role("test2", true, true, true, true, true, true, true, true, true));
|
||||
roles.add(new Role("test1", true, true, true, true, true, true, true, true, true, true));
|
||||
roles.add(new Role("test2", true, true, true, true, true, true, true, true, true, true));
|
||||
securityRepository.addMatch("queues.aq", roles);
|
||||
HashSet<Role> roles2 = new HashSet<>(2);
|
||||
roles2.add(new Role("test1", true, true, true, true, true, true, true, true, true));
|
||||
roles2.add(new Role("test2", true, true, true, true, true, true, true, true, true));
|
||||
roles2.add(new Role("test3", true, true, true, true, true, true, true, true, true));
|
||||
roles2.add(new Role("test1", true, true, true, true, true, true, true, true, true, true));
|
||||
roles2.add(new Role("test2", true, true, true, true, true, true, true, true, true, true));
|
||||
roles2.add(new Role("test3", true, true, true, true, true, true, true, true, true, true));
|
||||
securityRepository.addMatch("queues.another.andanother", roles2);
|
||||
|
||||
HashSet<Role> hashSet = securityRepository.getMatch("queues.another.andanother");
|
||||
|
@ -89,8 +89,8 @@ public class RepositoryTest extends ActiveMQTestBase {
|
|||
public void testWithoutWildcard() {
|
||||
securityRepository.addMatch("queues.1.*", new HashSet<Role>());
|
||||
HashSet<Role> roles = new HashSet<>(2);
|
||||
roles.add(new Role("test1", true, true, true, true, true, true, true, true, true));
|
||||
roles.add(new Role("test2", true, true, true, true, true, true, true, true, true));
|
||||
roles.add(new Role("test1", true, true, true, true, true, true, true, true, true, true));
|
||||
roles.add(new Role("test2", true, true, true, true, true, true, true, true, true, true));
|
||||
securityRepository.addMatch("queues.2.aq", roles);
|
||||
HashSet<Role> hashSet = securityRepository.getMatch("queues.2.aq");
|
||||
Assert.assertEquals(hashSet.size(), 2);
|
||||
|
|
|
@ -268,6 +268,10 @@
|
|||
<auto-delete-jms-queues>true</auto-delete-jms-queues>
|
||||
<auto-create-jms-topics>true</auto-create-jms-topics>
|
||||
<auto-delete-jms-topics>true</auto-delete-jms-topics>
|
||||
<auto-create-queues>true</auto-create-queues>
|
||||
<auto-delete-queues>true</auto-delete-queues>
|
||||
<auto-create-addresses>true</auto-create-addresses>
|
||||
<auto-delete-addresses>true</auto-delete-addresses>
|
||||
</address-setting>
|
||||
<address-setting match="a2">
|
||||
<dead-letter-address>a2.1</dead-letter-address>
|
||||
|
@ -284,6 +288,10 @@
|
|||
<auto-delete-jms-queues>false</auto-delete-jms-queues>
|
||||
<auto-create-jms-topics>false</auto-create-jms-topics>
|
||||
<auto-delete-jms-topics>false</auto-delete-jms-topics>
|
||||
<auto-create-queues>false</auto-create-queues>
|
||||
<auto-delete-queues>false</auto-delete-queues>
|
||||
<auto-create-addresses>false</auto-create-addresses>
|
||||
<auto-delete-addresses>false</auto-delete-addresses>
|
||||
</address-setting>
|
||||
</address-settings>
|
||||
<resource-limit-settings>
|
||||
|
|
|
@ -19,7 +19,7 @@
|
|||
<parent>
|
||||
<groupId>org.apache.activemq</groupId>
|
||||
<artifactId>artemis-pom</artifactId>
|
||||
<version>1.5.0-SNAPSHOT</version>
|
||||
<version>2.0.0-SNAPSHOT</version>
|
||||
</parent>
|
||||
|
||||
<name>ActiveMQ Artemis Tools</name>
|
||||
|
|
|
@ -88,6 +88,10 @@ entry that would be found in the `broker.xml` file.
|
|||
<slow-consumer-threshold>-1</slow-consumer-threshold>
|
||||
<slow-consumer-policy>NOTIFY</slow-consumer-policy>
|
||||
<slow-consumer-check-period>5</slow-consumer-check-period>
|
||||
<auto-create-jms-queues>true</auto-create-jms-queues> <!-- DEPRECATED see auto-create-queues>
|
||||
<auto-delete-jms-queues>true</auto-delete-jms-queues> <!-- DEPRECATED see auto-delete-queues>
|
||||
<auto-create-jms-topics>true</auto-create-jms-topics> <!-- DEPRECATED see auto-create-addresses>
|
||||
<auto-delete-jms-topics>true</auto-delete-jms-topics> <!-- DEPRECATED see auto-delete-addresses>
|
||||
<auto-create-jms-queues>true</auto-create-jms-queues>
|
||||
<auto-delete-jms-queues>true</auto-delete-jms-queues>
|
||||
<auto-create-jms-topics>true</auto-create-jms-topics>
|
||||
|
@ -179,18 +183,38 @@ create a JMS queue when a JMS message is sent to a queue whose name fits
|
|||
the address `match` (remember, a JMS queue is just a core queue which has
|
||||
the same address and queue name) or a JMS consumer tries to connect to a
|
||||
queue whose name fits the address `match`. Queues which are auto-created
|
||||
are durable, non-temporary, and non-transient. Default is `true`.
|
||||
are durable, non-temporary, and non-transient. Default is `true`. This is
|
||||
_DEPRECATED_. See `auto-create-queues`.
|
||||
|
||||
`auto-delete-jms-queues`. Whether or not the broker should automatically
|
||||
delete auto-created JMS queues when they have both 0 consumers and 0 messages.
|
||||
Default is `true`.
|
||||
Default is `true`. This is _DEPRECATED_. See `auto-delete-queues`.
|
||||
|
||||
`auto-create-jms-topics`. Whether or not the broker should automatically
|
||||
create a JMS topic when a JMS message is sent to a topic whose name fits
|
||||
the address `match` (remember, a JMS topic is just a core address which has
|
||||
one or more core queues mapped to it) or a JMS consumer tries to subscribe
|
||||
to a topic whose name fits the address `match`. Default is `true`.
|
||||
to a topic whose name fits the address `match`. Default is `true`. This is
|
||||
_DEPRECATED_. See `auto-create-addresses`.
|
||||
|
||||
`auto-delete-jms-topics`. Whether or not the broker should automatically
|
||||
delete auto-created JMS topics once the last subscription on the topic has
|
||||
been closed. Default is `true`.
|
||||
been closed. Default is `true`. This is _DEPRECATED_. See `auto-delete-addresses`.
|
||||
|
||||
`auto-create-queues`. Whether or not the broker should automatically
|
||||
create a queue when a message is sent or a consumer tries to connect to a
|
||||
queue whose name fits the address `match`. Queues which are auto-created
|
||||
are durable, non-temporary, and non-transient. Default is `true`.
|
||||
|
||||
`auto-delete-queues`. Whether or not the broker should automatically
|
||||
delete auto-created queues when they have both 0 consumers and 0 messages.
|
||||
Default is `true`.
|
||||
|
||||
`auto-create-addresses`. Whether or not the broker should automatically
|
||||
create an address when a message is sent to or a consumer tries to consume
|
||||
from a queue which is mapped to an address whose name fits the address `match`.
|
||||
Default is `true`.
|
||||
|
||||
`auto-delete-addresses`. Whether or not the broker should automatically
|
||||
delete auto-created addresses once the address no longer has any queues.
|
||||
Default is `true`.
|
||||
|
|
|
@ -50,7 +50,6 @@ under the License.
|
|||
<p>The cli create method will define this section by default if you use --clustered as a parameter</p>
|
||||
<pre class="prettyprint">
|
||||
<code><cluster-connection name="my-cluster">
|
||||
<address>jms</address>
|
||||
<retry-interval>500</retry-interval>
|
||||
<use-duplicate-detection>true</use-duplicate-detection>
|
||||
<message-load-balancing>STRICT</message-load-balancing>
|
||||
|
|
|
@ -124,6 +124,8 @@ public class ClusteredDurableSubscriptionExample {
|
|||
if (connection1 != null) {
|
||||
connection1.close();
|
||||
}
|
||||
|
||||
Thread.sleep(1000);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -68,7 +68,6 @@ under the License.
|
|||
|
||||
<cluster-connections>
|
||||
<cluster-connection name="my-cluster">
|
||||
<address>jms</address>
|
||||
<connector-ref>netty-connector</connector-ref>
|
||||
<retry-interval>500</retry-interval>
|
||||
<use-duplicate-detection>true</use-duplicate-detection>
|
||||
|
@ -82,7 +81,7 @@ under the License.
|
|||
|
||||
<security-settings>
|
||||
<!--security for example queue-->
|
||||
<security-setting match="jms.topic.exampleTopic">
|
||||
<security-setting match="exampleTopic">
|
||||
<permission type="createDurableQueue" roles="guest"/>
|
||||
<permission type="deleteDurableQueue" roles="guest"/>
|
||||
<permission type="createNonDurableQueue" roles="guest"/>
|
||||
|
|
|
@ -67,7 +67,6 @@ under the License.
|
|||
|
||||
<cluster-connections>
|
||||
<cluster-connection name="my-cluster">
|
||||
<address>jms</address>
|
||||
<connector-ref>netty-connector</connector-ref>
|
||||
<retry-interval>500</retry-interval>
|
||||
<use-duplicate-detection>true</use-duplicate-detection>
|
||||
|
@ -81,7 +80,7 @@ under the License.
|
|||
|
||||
<security-settings>
|
||||
<!--security for example queue-->
|
||||
<security-setting match="jms.topic.exampleTopic">
|
||||
<security-setting match="exampleTopic">
|
||||
<permission type="createDurableQueue" roles="guest"/>
|
||||
<permission type="deleteDurableQueue" roles="guest"/>
|
||||
<permission type="createNonDurableQueue" roles="guest"/>
|
||||
|
|
|
@ -37,7 +37,6 @@ under the License.
|
|||
<code>
|
||||
<cluster-connections>
|
||||
<cluster-connection name="my-cluster">
|
||||
<address>jms</address>
|
||||
<connector-ref>netty-connector</connector-ref>
|
||||
<retry-interval>500</retry-interval>
|
||||
<use-duplicate-detection>true</use-duplicate-detection>
|
||||
|
@ -60,7 +59,6 @@ under the License.
|
|||
<code>
|
||||
<cluster-connections>
|
||||
<cluster-connection name="my-cluster">
|
||||
<address>jms</address>
|
||||
<retry-interval>500</retry-interval>
|
||||
<use-duplicate-detection>true</use-duplicate-detection>
|
||||
<message-load-balancing>STRICT</message-load-balancing>
|
||||
|
|
|
@ -69,7 +69,6 @@ under the License.
|
|||
|
||||
<cluster-connections>
|
||||
<cluster-connection name="my-cluster">
|
||||
<address>jms</address>
|
||||
<connector-ref>netty-connector</connector-ref>
|
||||
<retry-interval>500</retry-interval>
|
||||
<use-duplicate-detection>true</use-duplicate-detection>
|
||||
|
@ -81,7 +80,7 @@ under the License.
|
|||
|
||||
<grouping-handler name="my-grouping-handler">
|
||||
<type>LOCAL</type>
|
||||
<address>jms</address>
|
||||
<address>exampleQueue</address>
|
||||
<timeout>5000</timeout>
|
||||
<group-timeout>-1</group-timeout>
|
||||
<reaper-period>30000</reaper-period>
|
||||
|
@ -91,7 +90,7 @@ under the License.
|
|||
|
||||
<security-settings>
|
||||
<!--security for example queue-->
|
||||
<security-setting match="jms.queue.exampleQueue">
|
||||
<security-setting match="exampleQueue">
|
||||
<permission type="createDurableQueue" roles="guest"/>
|
||||
<permission type="deleteDurableQueue" roles="guest"/>
|
||||
<permission type="createNonDurableQueue" roles="guest"/>
|
||||
|
|
|
@ -68,7 +68,6 @@ under the License.
|
|||
|
||||
<cluster-connections>
|
||||
<cluster-connection name="my-cluster">
|
||||
<address>jms</address>
|
||||
<connector-ref>netty-connector</connector-ref>
|
||||
<retry-interval>500</retry-interval>
|
||||
<use-duplicate-detection>true</use-duplicate-detection>
|
||||
|
@ -80,7 +79,7 @@ under the License.
|
|||
|
||||
<grouping-handler name="my-grouping-handler">
|
||||
<type>REMOTE</type>
|
||||
<address>jms</address>
|
||||
<address>exampleQueue</address>
|
||||
<timeout>5000</timeout>
|
||||
</grouping-handler>
|
||||
|
||||
|
@ -88,7 +87,7 @@ under the License.
|
|||
|
||||
<security-settings>
|
||||
<!--security for example queue-->
|
||||
<security-setting match="jms.queue.exampleQueue">
|
||||
<security-setting match="exampleQueue">
|
||||
<permission type="createDurableQueue" roles="guest"/>
|
||||
<permission type="deleteDurableQueue" roles="guest"/>
|
||||
<permission type="createNonDurableQueue" roles="guest"/>
|
||||
|
|
|
@ -68,7 +68,6 @@ under the License.
|
|||
|
||||
<cluster-connections>
|
||||
<cluster-connection name="my-cluster">
|
||||
<address>jms</address>
|
||||
<connector-ref>netty-connector</connector-ref>
|
||||
<retry-interval>500</retry-interval>
|
||||
<use-duplicate-detection>true</use-duplicate-detection>
|
||||
|
@ -80,7 +79,7 @@ under the License.
|
|||
|
||||
<grouping-handler name="my-grouping-handler">
|
||||
<type>REMOTE</type>
|
||||
<address>jms</address>
|
||||
<address>exampleQueue</address>
|
||||
<timeout>5000</timeout>
|
||||
</grouping-handler>
|
||||
|
||||
|
@ -88,7 +87,7 @@ under the License.
|
|||
|
||||
<security-settings>
|
||||
<!--security for example queue-->
|
||||
<security-setting match="jms.queue.exampleQueue">
|
||||
<security-setting match="exampleQueue">
|
||||
<permission type="createDurableQueue" roles="guest"/>
|
||||
<permission type="deleteDurableQueue" roles="guest"/>
|
||||
<permission type="createNonDurableQueue" roles="guest"/>
|
||||
|
|
|
@ -69,7 +69,6 @@ under the License.
|
|||
|
||||
<cluster-connections>
|
||||
<cluster-connection name="my-cluster">
|
||||
<address>jms</address>
|
||||
<connector-ref>netty-connector</connector-ref>
|
||||
<retry-interval>500</retry-interval>
|
||||
<use-duplicate-detection>true</use-duplicate-detection>
|
||||
|
@ -83,7 +82,7 @@ under the License.
|
|||
|
||||
<security-settings>
|
||||
<!--security for example queue-->
|
||||
<security-setting match="jms.queue.exampleQueue">
|
||||
<security-setting match="exampleQueue">
|
||||
<permission type="createDurableQueue" roles="guest"/>
|
||||
<permission type="deleteDurableQueue" roles="guest"/>
|
||||
<permission type="createNonDurableQueue" roles="guest"/>
|
||||
|
|
|
@ -68,7 +68,6 @@ under the License.
|
|||
|
||||
<cluster-connections>
|
||||
<cluster-connection name="my-cluster">
|
||||
<address>jms</address>
|
||||
<connector-ref>netty-connector</connector-ref>
|
||||
<retry-interval>500</retry-interval>
|
||||
<use-duplicate-detection>true</use-duplicate-detection>
|
||||
|
@ -82,7 +81,7 @@ under the License.
|
|||
|
||||
<security-settings>
|
||||
<!--security for example queue-->
|
||||
<security-setting match="jms.queue.exampleQueue">
|
||||
<security-setting match="exampleQueue">
|
||||
<permission type="createDurableQueue" roles="guest"/>
|
||||
<permission type="deleteDurableQueue" roles="guest"/>
|
||||
<permission type="createNonDurableQueue" roles="guest"/>
|
||||
|
|
|
@ -40,7 +40,6 @@ under the License.
|
|||
and to load balance the messages between the nodes.</p>
|
||||
<pre class="prettyprint">
|
||||
<code><cluster-connection name="my-cluster">
|
||||
<address>jms</address>
|
||||
<connector-ref>netty-connector</connector-ref>
|
||||
<retry-interval>500</retry-interval>
|
||||
<use-duplicate-detection>true</use-duplicate-detection>
|
||||
|
|
|
@ -67,7 +67,6 @@ under the License.
|
|||
|
||||
<cluster-connections>
|
||||
<cluster-connection name="my-cluster">
|
||||
<address>jms</address>
|
||||
<connector-ref>netty-connector</connector-ref>
|
||||
<retry-interval>500</retry-interval>
|
||||
<use-duplicate-detection>true</use-duplicate-detection>
|
||||
|
@ -81,7 +80,7 @@ under the License.
|
|||
|
||||
<security-settings>
|
||||
<!--security for example queue-->
|
||||
<security-setting match="jms.queue.exampleQueue">
|
||||
<security-setting match="exampleQueue">
|
||||
<permission type="createDurableQueue" roles="guest"/>
|
||||
<permission type="deleteDurableQueue" roles="guest"/>
|
||||
<permission type="createNonDurableQueue" roles="guest"/>
|
||||
|
|
|
@ -68,7 +68,6 @@ under the License.
|
|||
|
||||
<cluster-connections>
|
||||
<cluster-connection name="my-cluster">
|
||||
<address>jms</address>
|
||||
<connector-ref>netty-connector</connector-ref>
|
||||
<retry-interval>500</retry-interval>
|
||||
<use-duplicate-detection>true</use-duplicate-detection>
|
||||
|
@ -82,7 +81,7 @@ under the License.
|
|||
|
||||
<security-settings>
|
||||
<!--security for example queue-->
|
||||
<security-setting match="jms.queue.exampleQueue">
|
||||
<security-setting match="exampleQueue">
|
||||
<permission type="createDurableQueue" roles="guest"/>
|
||||
<permission type="deleteDurableQueue" roles="guest"/>
|
||||
<permission type="createNonDurableQueue" roles="guest"/>
|
||||
|
|
|
@ -40,7 +40,6 @@ under the License.
|
|||
and to load balance the messages between the nodes.</p>
|
||||
<pre class="prettyprint">
|
||||
<code><cluster-connection name="my-cluster">
|
||||
<address>jms</address>
|
||||
<connector-ref>netty-connector</connector-ref>
|
||||
<retry-interval>500</retry-interval>
|
||||
<use-duplicate-detection>true</use-duplicate-detection>
|
||||
|
|
|
@ -56,7 +56,7 @@ under the License.
|
|||
|
||||
<security-settings>
|
||||
<!--security for example queue-->
|
||||
<security-setting match="jms.queue.exampleQueue">
|
||||
<security-setting match="exampleQueue">
|
||||
<permission type="createDurableQueue" roles="guest"/>
|
||||
<permission type="deleteDurableQueue" roles="guest"/>
|
||||
<permission type="createNonDurableQueue" roles="guest"/>
|
||||
|
|
|
@ -56,7 +56,7 @@ under the License.
|
|||
|
||||
<security-settings>
|
||||
<!--security for example queue-->
|
||||
<security-setting match="jms.queue.exampleQueue">
|
||||
<security-setting match="exampleQueue">
|
||||
<permission type="createDurableQueue" roles="guest"/>
|
||||
<permission type="deleteDurableQueue" roles="guest"/>
|
||||
<permission type="createNonDurableQueue" roles="guest"/>
|
||||
|
|
|
@ -52,7 +52,7 @@
|
|||
|
||||
<security-settings>
|
||||
<!--security for example queue-->
|
||||
<security-setting match="jms.queue.exampleQueue">
|
||||
<security-setting match="exampleQueue">
|
||||
<permission type="createDurableQueue" roles="guest"/>
|
||||
<permission type="deleteDurableQueue" roles="guest"/>
|
||||
<permission type="createNonDurableQueue" roles="guest"/>
|
||||
|
|
|
@ -53,7 +53,7 @@
|
|||
|
||||
<security-settings>
|
||||
<!--security for example queue-->
|
||||
<security-setting match="jms.queue.exampleQueue">
|
||||
<security-setting match="exampleQueue">
|
||||
<permission type="createDurableQueue" roles="guest"/>
|
||||
<permission type="deleteDurableQueue" roles="guest"/>
|
||||
<permission type="createNonDurableQueue" roles="guest"/>
|
||||
|
|
|
@ -40,7 +40,6 @@ under the License.
|
|||
and to load balance the messages between the nodes.</p>
|
||||
<pre class="prettyprint">
|
||||
<code><cluster-connection name="my-cluster">
|
||||
<address>jms</address>
|
||||
<connector-ref>netty-connector</connector-ref>
|
||||
<retry-interval>500</retry-interval>
|
||||
<use-duplicate-detection>true</use-duplicate-detection>
|
||||
|
|
|
@ -52,7 +52,6 @@ under the License.
|
|||
|
||||
<cluster-connections>
|
||||
<cluster-connection name="my-cluster">
|
||||
<address>jms</address>
|
||||
<connector-ref>netty-connector</connector-ref>
|
||||
<retry-interval>500</retry-interval>
|
||||
<use-duplicate-detection>true</use-duplicate-detection>
|
||||
|
@ -68,7 +67,7 @@ under the License.
|
|||
|
||||
<security-settings>
|
||||
<!--security for example queue-->
|
||||
<security-setting match="jms.queue.exampleQueue">
|
||||
<security-setting match="exampleQueue">
|
||||
<permission type="createDurableQueue" roles="guest"/>
|
||||
<permission type="deleteDurableQueue" roles="guest"/>
|
||||
<permission type="createNonDurableQueue" roles="guest"/>
|
||||
|
|
|
@ -52,7 +52,6 @@ under the License.
|
|||
<!-- Clustering configuration -->
|
||||
<cluster-connections>
|
||||
<cluster-connection name="my-cluster">
|
||||
<address>jms</address>
|
||||
<connector-ref>netty-connector</connector-ref>
|
||||
<retry-interval>500</retry-interval>
|
||||
<use-duplicate-detection>true</use-duplicate-detection>
|
||||
|
@ -68,7 +67,7 @@ under the License.
|
|||
|
||||
<security-settings>
|
||||
<!--security for example queue-->
|
||||
<security-setting match="jms.queue.exampleQueue">
|
||||
<security-setting match="exampleQueue">
|
||||
<permission type="createDurableQueue" roles="guest"/>
|
||||
<permission type="deleteDurableQueue" roles="guest"/>
|
||||
<permission type="createNonDurableQueue" roles="guest"/>
|
||||
|
|
|
@ -49,7 +49,6 @@
|
|||
<!-- Clustering configuration -->
|
||||
<cluster-connections>
|
||||
<cluster-connection name="my-cluster">
|
||||
<address>jms</address>
|
||||
<connector-ref>netty-connector</connector-ref>
|
||||
<retry-interval>500</retry-interval>
|
||||
<use-duplicate-detection>true</use-duplicate-detection>
|
||||
|
@ -65,7 +64,7 @@
|
|||
|
||||
<security-settings>
|
||||
<!--security for example queue-->
|
||||
<security-setting match="jms.queue.exampleQueue">
|
||||
<security-setting match="exampleQueue">
|
||||
<permission type="createDurableQueue" roles="guest"/>
|
||||
<permission type="deleteDurableQueue" roles="guest"/>
|
||||
<permission type="createNonDurableQueue" roles="guest"/>
|
||||
|
|
|
@ -49,7 +49,6 @@
|
|||
<!-- Clustering configuration -->
|
||||
<cluster-connections>
|
||||
<cluster-connection name="my-cluster">
|
||||
<address>jms</address>
|
||||
<connector-ref>netty-connector</connector-ref>
|
||||
<retry-interval>500</retry-interval>
|
||||
<use-duplicate-detection>true</use-duplicate-detection>
|
||||
|
@ -65,7 +64,7 @@
|
|||
|
||||
<security-settings>
|
||||
<!--security for example queue-->
|
||||
<security-setting match="jms.queue.exampleQueue">
|
||||
<security-setting match="exampleQueue">
|
||||
<permission type="createDurableQueue" roles="guest"/>
|
||||
<permission type="deleteDurableQueue" roles="guest"/>
|
||||
<permission type="createNonDurableQueue" roles="guest"/>
|
||||
|
|
|
@ -46,7 +46,6 @@ under the License.
|
|||
<pre class="prettyprint">
|
||||
<code>
|
||||
<cluster-connection name="my-cluster">
|
||||
<address>jms</address>
|
||||
<connector-ref>netty-connector</connector-ref>
|
||||
<retry-interval>500</retry-interval>
|
||||
<use-duplicate-detection>true</use-duplicate-detection>
|
||||
|
|
|
@ -51,7 +51,6 @@
|
|||
|
||||
<cluster-connections>
|
||||
<cluster-connection name="my-cluster">
|
||||
<address>jms</address>
|
||||
<connector-ref>netty-connector</connector-ref>
|
||||
<retry-interval>500</retry-interval>
|
||||
<use-duplicate-detection>true</use-duplicate-detection>
|
||||
|
@ -67,7 +66,7 @@
|
|||
|
||||
<security-settings>
|
||||
<!--security for example queue-->
|
||||
<security-setting match="jms.queue.exampleQueue">
|
||||
<security-setting match="exampleQueue">
|
||||
<permission type="createDurableQueue" roles="guest"/>
|
||||
<permission type="deleteDurableQueue" roles="guest"/>
|
||||
<permission type="createNonDurableQueue" roles="guest"/>
|
||||
|
|
|
@ -51,7 +51,6 @@
|
|||
<!-- Clustering configuration -->
|
||||
<cluster-connections>
|
||||
<cluster-connection name="my-cluster">
|
||||
<address>jms</address>
|
||||
<connector-ref>netty-connector</connector-ref>
|
||||
<retry-interval>500</retry-interval>
|
||||
<use-duplicate-detection>true</use-duplicate-detection>
|
||||
|
@ -67,7 +66,7 @@
|
|||
|
||||
<security-settings>
|
||||
<!--security for example queue-->
|
||||
<security-setting match="jms.queue.exampleQueue">
|
||||
<security-setting match="exampleQueue">
|
||||
<permission type="createDurableQueue" roles="guest"/>
|
||||
<permission type="deleteDurableQueue" roles="guest"/>
|
||||
<permission type="createNonDurableQueue" roles="guest"/>
|
||||
|
|
|
@ -49,7 +49,6 @@
|
|||
<!-- Clustering configuration -->
|
||||
<cluster-connections>
|
||||
<cluster-connection name="my-cluster">
|
||||
<address>jms</address>
|
||||
<connector-ref>netty-connector</connector-ref>
|
||||
<retry-interval>500</retry-interval>
|
||||
<use-duplicate-detection>true</use-duplicate-detection>
|
||||
|
@ -62,7 +61,7 @@
|
|||
|
||||
<security-settings>
|
||||
<!--security for example queue-->
|
||||
<security-setting match="jms.queue.exampleQueue">
|
||||
<security-setting match="exampleQueue">
|
||||
<permission type="createDurableQueue" roles="guest"/>
|
||||
<permission type="deleteDurableQueue" roles="guest"/>
|
||||
<permission type="createNonDurableQueue" roles="guest"/>
|
||||
|
|
|
@ -75,7 +75,7 @@ under the License.
|
|||
|
||||
<security-settings>
|
||||
<!--security for example queue-->
|
||||
<security-setting match="jms.topic.exampleTopic">
|
||||
<security-setting match="exampleTopic">
|
||||
<permission type="createDurableQueue" roles="guest"/>
|
||||
<permission type="deleteDurableQueue" roles="guest"/>
|
||||
<permission type="createNonDurableQueue" roles="guest"/>
|
||||
|
|
|
@ -73,7 +73,7 @@ under the License.
|
|||
|
||||
<security-settings>
|
||||
<!--security for example queue-->
|
||||
<security-setting match="jms.topic.exampleTopic">
|
||||
<security-setting match="exampleTopic">
|
||||
<permission type="createDurableQueue" roles="guest"/>
|
||||
<permission type="deleteDurableQueue" roles="guest"/>
|
||||
<permission type="createNonDurableQueue" roles="guest"/>
|
||||
|
|
|
@ -40,7 +40,6 @@ under the License.
|
|||
and to load balance the messages between the nodes.</p>
|
||||
<pre class="prettyprint">
|
||||
<code><cluster-connection name="my-cluster">
|
||||
<address>jms</address>
|
||||
<retry-interval>500</retry-interval>
|
||||
<use-duplicate-detection>true</use-duplicate-detection>
|
||||
<message-load-balancing>STRICT</message-load-balancing>
|
||||
|
|
|
@ -69,7 +69,6 @@ under the License.
|
|||
|
||||
<cluster-connections>
|
||||
<cluster-connection name="my-cluster">
|
||||
<address>jms</address>
|
||||
<connector-ref>netty-connector</connector-ref>
|
||||
<retry-interval>500</retry-interval>
|
||||
<use-duplicate-detection>true</use-duplicate-detection>
|
||||
|
@ -83,7 +82,7 @@ under the License.
|
|||
|
||||
<security-settings>
|
||||
<!--security for example queue-->
|
||||
<security-setting match="jms.topic.exampleTopic">
|
||||
<security-setting match="exampleTopic">
|
||||
<permission type="createDurableQueue" roles="guest"/>
|
||||
<permission type="deleteDurableQueue" roles="guest"/>
|
||||
<permission type="createNonDurableQueue" roles="guest"/>
|
||||
|
|
|
@ -67,7 +67,6 @@ under the License.
|
|||
|
||||
<cluster-connections>
|
||||
<cluster-connection name="my-cluster">
|
||||
<address>jms</address>
|
||||
<connector-ref>netty-connector</connector-ref>
|
||||
<retry-interval>500</retry-interval>
|
||||
<use-duplicate-detection>true</use-duplicate-detection>
|
||||
|
@ -81,7 +80,7 @@ under the License.
|
|||
|
||||
<security-settings>
|
||||
<!--security for example queue-->
|
||||
<security-setting match="jms.topic.exampleTopic">
|
||||
<security-setting match="exampleTopic">
|
||||
<permission type="createDurableQueue" roles="guest"/>
|
||||
<permission type="deleteDurableQueue" roles="guest"/>
|
||||
<permission type="createNonDurableQueue" roles="guest"/>
|
||||
|
|
|
@ -67,7 +67,6 @@ under the License.
|
|||
|
||||
<cluster-connections>
|
||||
<cluster-connection name="my-cluster">
|
||||
<address>jms</address>
|
||||
<connector-ref>netty-connector</connector-ref>
|
||||
<retry-interval>500</retry-interval>
|
||||
<use-duplicate-detection>true</use-duplicate-detection>
|
||||
|
@ -81,7 +80,7 @@ under the License.
|
|||
|
||||
<security-settings>
|
||||
<!--security for example queue-->
|
||||
<security-setting match="jms.queue.exampleQueue">
|
||||
<security-setting match="exampleQueue">
|
||||
<permission type="createDurableQueue" roles="guest"/>
|
||||
<permission type="deleteDurableQueue" roles="guest"/>
|
||||
<permission type="createNonDurableQueue" roles="guest"/>
|
||||
|
@ -97,7 +96,7 @@ under the License.
|
|||
Setting it to a value > 0 means how long to wait before redistributing, if a consumer is closed
|
||||
then another one quickly recreated you might want to set it thus, to avoid unnecessary
|
||||
redistribution -->
|
||||
<address-setting match="jms.#">
|
||||
<address-setting match="#">
|
||||
<redistribution-delay>0</redistribution-delay>
|
||||
</address-setting>
|
||||
</address-settings>
|
||||
|
|
|
@ -68,7 +68,6 @@ under the License.
|
|||
|
||||
<cluster-connections>
|
||||
<cluster-connection name="my-cluster">
|
||||
<address>jms</address>
|
||||
<connector-ref>netty-connector</connector-ref>
|
||||
<retry-interval>500</retry-interval>
|
||||
<use-duplicate-detection>true</use-duplicate-detection>
|
||||
|
@ -82,7 +81,7 @@ under the License.
|
|||
|
||||
<security-settings>
|
||||
<!--security for example queue-->
|
||||
<security-setting match="jms.queue.exampleQueue">
|
||||
<security-setting match="exampleQueue">
|
||||
<permission type="createDurableQueue" roles="guest"/>
|
||||
<permission type="deleteDurableQueue" roles="guest"/>
|
||||
<permission type="createNonDurableQueue" roles="guest"/>
|
||||
|
@ -98,7 +97,7 @@ under the License.
|
|||
Setting it to a value > 0 means how long to wait before redistributing, if a consumer is closed
|
||||
then another one quickly recreated you might want to set it thus, to avoid unnecessary
|
||||
redistribution -->
|
||||
<address-setting match="jms.#">
|
||||
<address-setting match="#">
|
||||
<redistribution-delay>0</redistribution-delay>
|
||||
</address-setting>
|
||||
</address-settings>
|
||||
|
|
|
@ -53,7 +53,6 @@ under the License.
|
|||
<pre class="prettyprint">
|
||||
<code>
|
||||
<cluster-connection name="my-cluster">
|
||||
<address>jms</address>
|
||||
<connector-ref>netty-connector</connector-ref>
|
||||
<retry-interval>500</retry-interval>
|
||||
<use-duplicate-detection>true</use-duplicate-detection>
|
||||
|
|
|
@ -71,7 +71,6 @@ under the License.
|
|||
|
||||
<cluster-connections>
|
||||
<cluster-connection name="my-cluster">
|
||||
<address>jms</address>
|
||||
<connector-ref>netty-connector</connector-ref>
|
||||
<retry-interval>500</retry-interval>
|
||||
<use-duplicate-detection>true</use-duplicate-detection>
|
||||
|
@ -85,7 +84,7 @@ under the License.
|
|||
|
||||
<security-settings>
|
||||
<!-- Default JMS security -->
|
||||
<security-setting match="jms.#">
|
||||
<security-setting match="#">
|
||||
<permission type="createDurableQueue" roles="guest"/>
|
||||
<permission type="deleteDurableQueue" roles="guest"/>
|
||||
<permission type="createNonDurableQueue" roles="guest"/>
|
||||
|
|
|
@ -69,7 +69,6 @@ under the License.
|
|||
|
||||
<cluster-connections>
|
||||
<cluster-connection name="my-cluster">
|
||||
<address>jms</address>
|
||||
<connector-ref>netty-connector</connector-ref>
|
||||
<retry-interval>500</retry-interval>
|
||||
<use-duplicate-detection>true</use-duplicate-detection>
|
||||
|
@ -83,7 +82,7 @@ under the License.
|
|||
|
||||
<security-settings>
|
||||
<!-- Default JMS security -->
|
||||
<security-setting match="jms.#">
|
||||
<security-setting match="#">
|
||||
<permission type="createDurableQueue" roles="guest"/>
|
||||
<permission type="deleteDurableQueue" roles="guest"/>
|
||||
<permission type="createNonDurableQueue" roles="guest"/>
|
||||
|
|
|
@ -69,7 +69,6 @@ under the License.
|
|||
|
||||
<cluster-connections>
|
||||
<cluster-connection name="my-cluster">
|
||||
<address>jms</address>
|
||||
<connector-ref>netty-connector</connector-ref>
|
||||
<retry-interval>500</retry-interval>
|
||||
<use-duplicate-detection>true</use-duplicate-detection>
|
||||
|
@ -83,7 +82,7 @@ under the License.
|
|||
|
||||
<security-settings>
|
||||
<!-- Default JMS security -->
|
||||
<security-setting match="jms.#">
|
||||
<security-setting match="#">
|
||||
<permission type="createDurableQueue" roles="guest"/>
|
||||
<permission type="deleteDurableQueue" roles="guest"/>
|
||||
<permission type="createNonDurableQueue" roles="guest"/>
|
||||
|
|
|
@ -69,7 +69,6 @@ under the License.
|
|||
|
||||
<cluster-connections>
|
||||
<cluster-connection name="my-cluster">
|
||||
<address>jms</address>
|
||||
<connector-ref>netty-connector</connector-ref>
|
||||
<retry-interval>500</retry-interval>
|
||||
<use-duplicate-detection>true</use-duplicate-detection>
|
||||
|
@ -83,7 +82,7 @@ under the License.
|
|||
|
||||
<security-settings>
|
||||
<!-- Default JMS security -->
|
||||
<security-setting match="jms.#">
|
||||
<security-setting match="#">
|
||||
<permission type="createDurableQueue" roles="guest"/>
|
||||
<permission type="deleteDurableQueue" roles="guest"/>
|
||||
<permission type="createNonDurableQueue" roles="guest"/>
|
||||
|
|
|
@ -68,7 +68,6 @@ under the License.
|
|||
|
||||
<cluster-connections>
|
||||
<cluster-connection name="my-cluster">
|
||||
<address>jms</address>
|
||||
<connector-ref>netty-connector</connector-ref>
|
||||
<retry-interval>500</retry-interval>
|
||||
<use-duplicate-detection>true</use-duplicate-detection>
|
||||
|
@ -82,7 +81,7 @@ under the License.
|
|||
|
||||
<security-settings>
|
||||
<!-- Default JMS security -->
|
||||
<security-setting match="jms.#">
|
||||
<security-setting match="#">
|
||||
<permission type="createDurableQueue" roles="guest"/>
|
||||
<permission type="deleteDurableQueue" roles="guest"/>
|
||||
<permission type="createNonDurableQueue" roles="guest"/>
|
||||
|
|
|
@ -68,7 +68,6 @@ under the License.
|
|||
|
||||
<cluster-connections>
|
||||
<cluster-connection name="my-cluster">
|
||||
<address>jms</address>
|
||||
<connector-ref>netty-connector</connector-ref>
|
||||
<retry-interval>500</retry-interval>
|
||||
<use-duplicate-detection>true</use-duplicate-detection>
|
||||
|
@ -82,7 +81,7 @@ under the License.
|
|||
|
||||
<security-settings>
|
||||
<!-- Default JMS security -->
|
||||
<security-setting match="jms.#">
|
||||
<security-setting match="#">
|
||||
<permission type="createDurableQueue" roles="guest"/>
|
||||
<permission type="deleteDurableQueue" roles="guest"/>
|
||||
<permission type="createNonDurableQueue" roles="guest"/>
|
||||
|
|
|
@ -69,13 +69,12 @@ under the License.
|
|||
|
||||
<cluster-connections>
|
||||
<cluster-connection name="my-cluster">
|
||||
<address>jms</address>
|
||||
<connector-ref>netty-connector</connector-ref>
|
||||
<retry-interval>500</retry-interval>
|
||||
<!-- since the backup servers scale down we need a sensible setting here so the bridge will stop -->
|
||||
<reconnect-attempts>5</reconnect-attempts>
|
||||
<use-duplicate-detection>true</use-duplicate-detection>
|
||||
<message-load-balancing>STRICT</message-load-balancing>
|
||||
<message-load-balancing>OFF</message-load-balancing>
|
||||
<max-hops>1</max-hops>
|
||||
<discovery-group-ref discovery-group-name="my-discovery-group"/>
|
||||
</cluster-connection>
|
||||
|
@ -104,7 +103,7 @@ under the License.
|
|||
|
||||
<security-settings>
|
||||
<!--security for example queue-->
|
||||
<security-setting match="jms.queue.exampleQueue">
|
||||
<security-setting match="exampleQueue">
|
||||
<permission type="createDurableQueue" roles="guest"/>
|
||||
<permission type="deleteDurableQueue" roles="guest"/>
|
||||
<permission type="createNonDurableQueue" roles="guest"/>
|
||||
|
@ -112,7 +111,7 @@ under the License.
|
|||
<permission type="consume" roles="guest"/>
|
||||
<permission type="send" roles="guest"/>
|
||||
</security-setting>
|
||||
<security-setting match="jms.queue.activemq.management.#">
|
||||
<security-setting match="activemq.management.#">
|
||||
<permission type="createDurableQueue" roles="guest"/>
|
||||
<permission type="deleteDurableQueue" roles="guest"/>
|
||||
<permission type="createNonDurableQueue" roles="guest"/>
|
||||
|
@ -120,7 +119,7 @@ under the License.
|
|||
<permission type="consume" roles="guest"/>
|
||||
<permission type="send" roles="guest"/>
|
||||
</security-setting>
|
||||
<security-setting match="jms.queue.activemq.management">
|
||||
<security-setting match="activemq.management">
|
||||
<permission type="manage" roles="guest"/>
|
||||
</security-setting>
|
||||
</security-settings>
|
||||
|
|
|
@ -69,13 +69,12 @@ under the License.
|
|||
|
||||
<cluster-connections>
|
||||
<cluster-connection name="my-cluster">
|
||||
<address>jms</address>
|
||||
<connector-ref>netty-connector</connector-ref>
|
||||
<retry-interval>500</retry-interval>
|
||||
<!-- since the backup servers scale down we need a sensible setting here so the bridge will stop -->
|
||||
<reconnect-attempts>5</reconnect-attempts>
|
||||
<use-duplicate-detection>true</use-duplicate-detection>
|
||||
<message-load-balancing>STRICT</message-load-balancing>
|
||||
<message-load-balancing>OFF</message-load-balancing>
|
||||
<max-hops>1</max-hops>
|
||||
<discovery-group-ref discovery-group-name="my-discovery-group"/>
|
||||
</cluster-connection>
|
||||
|
@ -102,7 +101,7 @@ under the License.
|
|||
|
||||
<security-settings>
|
||||
<!--security for example queue-->
|
||||
<security-setting match="jms.queue.exampleQueue">
|
||||
<security-setting match="exampleQueue">
|
||||
<permission type="createDurableQueue" roles="guest"/>
|
||||
<permission type="deleteDurableQueue" roles="guest"/>
|
||||
<permission type="createNonDurableQueue" roles="guest"/>
|
||||
|
@ -110,7 +109,7 @@ under the License.
|
|||
<permission type="consume" roles="guest"/>
|
||||
<permission type="send" roles="guest"/>
|
||||
</security-setting>
|
||||
<security-setting match="jms.queue.activemq.management.#">
|
||||
<security-setting match="activemq.management.#">
|
||||
<permission type="createDurableQueue" roles="guest"/>
|
||||
<permission type="deleteDurableQueue" roles="guest"/>
|
||||
<permission type="createNonDurableQueue" roles="guest"/>
|
||||
|
@ -118,7 +117,7 @@ under the License.
|
|||
<permission type="consume" roles="guest"/>
|
||||
<permission type="send" roles="guest"/>
|
||||
</security-setting>
|
||||
<security-setting match="jms.queue.activemq.management">
|
||||
<security-setting match="activemq.management">
|
||||
<permission type="manage" roles="guest"/>
|
||||
</security-setting>
|
||||
</security-settings>
|
||||
|
|
|
@ -67,7 +67,6 @@ under the License.
|
|||
|
||||
<cluster-connections>
|
||||
<cluster-connection name="my-cluster">
|
||||
<address>jms</address>
|
||||
<connector-ref>netty-connector</connector-ref>
|
||||
<retry-interval>500</retry-interval>
|
||||
<use-duplicate-detection>true</use-duplicate-detection>
|
||||
|
@ -100,7 +99,7 @@ under the License.
|
|||
|
||||
<security-settings>
|
||||
<!--security for example queue-->
|
||||
<security-setting match="jms.queue.exampleQueue">
|
||||
<security-setting match="exampleQueue">
|
||||
<permission type="createDurableQueue" roles="guest"/>
|
||||
<permission type="deleteDurableQueue" roles="guest"/>
|
||||
<permission type="createNonDurableQueue" roles="guest"/>
|
||||
|
|
|
@ -67,7 +67,6 @@ under the License.
|
|||
|
||||
<cluster-connections>
|
||||
<cluster-connection name="my-cluster">
|
||||
<address>jms</address>
|
||||
<connector-ref>netty-connector</connector-ref>
|
||||
<retry-interval>500</retry-interval>
|
||||
<use-duplicate-detection>true</use-duplicate-detection>
|
||||
|
@ -100,7 +99,7 @@ under the License.
|
|||
|
||||
<security-settings>
|
||||
<!--security for example queue-->
|
||||
<security-setting match="jms.queue.exampleQueue">
|
||||
<security-setting match="exampleQueue">
|
||||
<permission type="createDurableQueue" roles="guest"/>
|
||||
<permission type="deleteDurableQueue" roles="guest"/>
|
||||
<permission type="createNonDurableQueue" roles="guest"/>
|
||||
|
|
|
@ -77,7 +77,6 @@ under the License.
|
|||
|
||||
<cluster-connections>
|
||||
<cluster-connection name="my-cluster">
|
||||
<address>jms</address>
|
||||
<connector-ref>netty-connector</connector-ref>
|
||||
<retry-interval>500</retry-interval>
|
||||
<use-duplicate-detection>true</use-duplicate-detection>
|
||||
|
|
|
@ -77,7 +77,6 @@ under the License.
|
|||
|
||||
<cluster-connections>
|
||||
<cluster-connection name="my-cluster">
|
||||
<address>jms</address>
|
||||
<connector-ref>netty-connector</connector-ref>
|
||||
<retry-interval>500</retry-interval>
|
||||
<use-duplicate-detection>true</use-duplicate-detection>
|
||||
|
|
|
@ -62,7 +62,6 @@ under the License.
|
|||
|
||||
<cluster-connections>
|
||||
<cluster-connection name="my-cluster">
|
||||
<address>jms</address>
|
||||
<connector-ref>netty-connector</connector-ref>
|
||||
<static-connectors>
|
||||
<connector-ref>netty-backup-connector</connector-ref>
|
||||
|
@ -73,7 +72,7 @@ under the License.
|
|||
|
||||
<security-settings>
|
||||
<!--security for example queue-->
|
||||
<security-setting match="jms.queue.exampleQueue">
|
||||
<security-setting match="exampleQueue">
|
||||
<permission type="createDurableQueue" roles="guest"/>
|
||||
<permission type="deleteDurableQueue" roles="guest"/>
|
||||
<permission type="createNonDurableQueue" roles="guest"/>
|
||||
|
|
|
@ -64,7 +64,6 @@ under the License.
|
|||
|
||||
<cluster-connections>
|
||||
<cluster-connection name="my-cluster">
|
||||
<address>jms</address>
|
||||
<connector-ref>netty-connector</connector-ref>
|
||||
<static-connectors>
|
||||
<connector-ref>netty-live-connector</connector-ref>
|
||||
|
@ -75,7 +74,7 @@ under the License.
|
|||
|
||||
<security-settings>
|
||||
<!--security for example queue-->
|
||||
<security-setting match="jms.queue.exampleQueue">
|
||||
<security-setting match="exampleQueue">
|
||||
<permission type="createDurableQueue" roles="guest"/>
|
||||
<permission type="deleteDurableQueue" roles="guest"/>
|
||||
<permission type="createNonDurableQueue" roles="guest"/>
|
||||
|
|
|
@ -78,7 +78,6 @@ under the License.
|
|||
|
||||
<cluster-connections>
|
||||
<cluster-connection name="my-cluster">
|
||||
<address>jms</address>
|
||||
<connector-ref>netty-connector</connector-ref>
|
||||
<discovery-group-ref discovery-group-name="dg-group1"/>
|
||||
</cluster-connection>
|
||||
|
@ -87,7 +86,7 @@ under the License.
|
|||
|
||||
<security-settings>
|
||||
<!--security for example queue-->
|
||||
<security-setting match="jms.queue.exampleQueue">
|
||||
<security-setting match="exampleQueue">
|
||||
<permission type="createDurableQueue" roles="guest"/>
|
||||
<permission type="deleteDurableQueue" roles="guest"/>
|
||||
<permission type="createNonDurableQueue" roles="guest"/>
|
||||
|
|
|
@ -79,7 +79,6 @@ under the License.
|
|||
|
||||
<cluster-connections>
|
||||
<cluster-connection name="my-cluster">
|
||||
<address>jms</address>
|
||||
<connector-ref>netty-connector</connector-ref>
|
||||
<discovery-group-ref discovery-group-name="dg-group1"/>
|
||||
</cluster-connection>
|
||||
|
@ -88,7 +87,7 @@ under the License.
|
|||
|
||||
<security-settings>
|
||||
<!--security for example queue-->
|
||||
<security-setting match="jms.queue.exampleQueue">
|
||||
<security-setting match="exampleQueue">
|
||||
<permission type="createDurableQueue" roles="guest"/>
|
||||
<permission type="deleteDurableQueue" roles="guest"/>
|
||||
<permission type="createNonDurableQueue" roles="guest"/>
|
||||
|
|
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in New Issue