ARTEMIS-922 Rename deleteOnNoConsumers throughout

The name "deleteOnNoConsumers" isn't a good match for the semantics underneath.
The name "purgeOnNoConsumers" (and variants) is a better fit.
This commit is contained in:
Justin Bertram 2017-01-17 09:49:32 -06:00
parent bc8d673e89
commit 8cf94623a4
65 changed files with 314 additions and 313 deletions

View File

@ -36,7 +36,7 @@ public class CreateQueue extends QueueAbstract {
performCoreManagement(new ManagementCallback<ClientMessage>() { performCoreManagement(new ManagementCallback<ClientMessage>() {
@Override @Override
public void setUpInvocation(ClientMessage message) throws Exception { public void setUpInvocation(ClientMessage message) throws Exception {
ManagementHelper.putOperationInvocation(message, "broker", "createQueue", getAddress(true), getRoutingType(), getName(), getFilter(), isDurable(), getMaxConsumers(-1), isDeleteOnNoConsumers(true), isAutoCreateAddress()); ManagementHelper.putOperationInvocation(message, "broker", "createQueue", getAddress(true), getRoutingType(), getName(), getFilter(), isDurable(), getMaxConsumers(-1), isPurgeOnNoConsumers(true), isAutoCreateAddress());
} }
@Override @Override

View File

@ -37,11 +37,11 @@ public class QueueAbstract extends AbstractAction {
@Option(name = "--no-durable", description = "whether the queue is durable or not (default input)") @Option(name = "--no-durable", description = "whether the queue is durable or not (default input)")
private Boolean noDurable; private Boolean noDurable;
@Option(name = "--delete-on-no-consumers", description = "whether to delete this queue when it's last consumers disconnects (default input)") @Option(name = "--purge-on-no-consumers", description = "whether to delete the contents of this queue when its last consumer disconnects (default input)")
private Boolean deleteOnNoConsumers; private Boolean purgeOnNoConsumers;
@Option(name = "--keep-on-no-consumers", description = "whether to queue this queue when it's last consumers disconnects (default input)") @Option(name = "--preserve-on-no-consumers", description = "whether to preserve the contents of this queue when its last consumer disconnects (default input)")
private Boolean keepOnNoConsumers; private Boolean preserveOnNoConsumers;
@Option(name = "--max-consumers", description = "Maximum number of consumers allowed on this queue at any one time (default no limit)") @Option(name = "--max-consumers", description = "Maximum number of consumers allowed on this queue at any one time (default no limit)")
private Integer maxConsumers; private Integer maxConsumers;
@ -97,12 +97,12 @@ public class QueueAbstract extends AbstractAction {
return this; return this;
} }
public boolean isKeepOnNoConsumers() { public boolean getPreserveOnNoConsumers() {
return keepOnNoConsumers; return preserveOnNoConsumers;
} }
public QueueAbstract setKeepOnNoConsumers(boolean keepOnNoConsumers) { public QueueAbstract setPreserveOnNoConsumers(boolean preserveOnNoConsumers) {
this.keepOnNoConsumers = keepOnNoConsumers; this.preserveOnNoConsumers = preserveOnNoConsumers;
return this; return this;
} }
@ -165,23 +165,23 @@ public class QueueAbstract extends AbstractAction {
return this; return this;
} }
public Boolean isDeleteOnNoConsumers() { public Boolean isPurgeOnNoConsumers() {
return isDeleteOnNoConsumers(false); return isPurgeOnNoConsumers(false);
} }
public Boolean isDeleteOnNoConsumers(boolean useInput) { public Boolean isPurgeOnNoConsumers(boolean useInput) {
Boolean value = null; Boolean value = null;
if (deleteOnNoConsumers != null) { if (purgeOnNoConsumers != null) {
value = deleteOnNoConsumers.booleanValue(); value = purgeOnNoConsumers.booleanValue();
} else if (keepOnNoConsumers != null) { } else if (preserveOnNoConsumers != null) {
value = !keepOnNoConsumers.booleanValue(); value = !preserveOnNoConsumers.booleanValue();
} }
if (value == null && useInput) { if (value == null && useInput) {
value = inputBoolean("--delete-on-no-consumers", "Delete on non consumers", false); value = inputBoolean("--purge-on-no-consumers", "Purge the contents of the queue once there are no consumers", false);
} }
if (value == null) { if (value == null) {
@ -189,8 +189,8 @@ public class QueueAbstract extends AbstractAction {
return null; return null;
} }
deleteOnNoConsumers = value.booleanValue(); purgeOnNoConsumers = value.booleanValue();
keepOnNoConsumers = !value.booleanValue(); preserveOnNoConsumers = !value.booleanValue();
return value; return value;
} }
@ -199,8 +199,8 @@ public class QueueAbstract extends AbstractAction {
this.maxConsumers = maxConsumers; this.maxConsumers = maxConsumers;
} }
public void setDeleteOnNoConsumers(boolean deleteOnNoConsumers) { public void setPurgeOnNoConsumers(boolean purgeOnNoConsumers) {
this.deleteOnNoConsumers = deleteOnNoConsumers; this.purgeOnNoConsumers = purgeOnNoConsumers;
} }
public void setAddress(String address) { public void setAddress(String address) {

View File

@ -36,7 +36,7 @@ public class UpdateQueue extends QueueAbstract {
performCoreManagement(new ManagementCallback<ClientMessage>() { performCoreManagement(new ManagementCallback<ClientMessage>() {
@Override @Override
public void setUpInvocation(ClientMessage message) throws Exception { public void setUpInvocation(ClientMessage message) throws Exception {
ManagementHelper.putOperationInvocation(message, "broker", "updateQueue", getName(), getRoutingType(), getMaxConsumers(null), isDeleteOnNoConsumers()); ManagementHelper.putOperationInvocation(message, "broker", "updateQueue", getName(), getRoutingType(), getMaxConsumers(null), isPurgeOnNoConsumers());
} }
@Override @Override

View File

@ -446,7 +446,7 @@ public final class ActiveMQDefaultConfiguration {
public static final int DEFAULT_MAX_QUEUE_CONSUMERS = -1; public static final int DEFAULT_MAX_QUEUE_CONSUMERS = -1;
public static final boolean DEFAULT_DELETE_QUEUE_ON_NO_CONSUMERS = false; public static final boolean DEFAULT_PURGE_ON_NO_CONSUMERS = false;
public static final RoutingType DEFAULT_ROUTING_TYPE = RoutingType.MULTICAST; public static final RoutingType DEFAULT_ROUTING_TYPE = RoutingType.MULTICAST;
@ -1217,8 +1217,8 @@ public final class ActiveMQDefaultConfiguration {
return DEFAULT_MAX_QUEUE_CONSUMERS; return DEFAULT_MAX_QUEUE_CONSUMERS;
} }
public static boolean getDefaultDeleteQueueOnNoConsumers() { public static boolean getDefaultPurgeOnNoConsumers() {
return DEFAULT_DELETE_QUEUE_ON_NO_CONSUMERS; return DEFAULT_PURGE_ON_NO_CONSUMERS;
} }
public static String getInternalNamingPrefix() { public static String getInternalNamingPrefix() {

View File

@ -71,7 +71,7 @@ public interface ClientSession extends XAResource, AutoCloseable {
*/ */
boolean isAutoCreateAddresses(); boolean isAutoCreateAddresses();
boolean isDefaultDeleteOnNoConsumers(); boolean isDefaultPurgeOnNoConsumers();
int getDefaultMaxConsumers(); int getDefaultMaxConsumers();
} }
@ -135,7 +135,7 @@ public interface ClientSession extends XAResource, AutoCloseable {
int getMaxConsumers(); int getMaxConsumers();
boolean isDeleteOnNoConsumers(); boolean isPurgeOnNoConsumers();
boolean isAutoCreated(); boolean isAutoCreated();
} }
@ -524,11 +524,11 @@ public interface ClientSession extends XAResource, AutoCloseable {
* @param durable whether the queue is durable or not * @param durable whether the queue is durable or not
* @param autoCreated whether to mark this queue as autoCreated or not * @param autoCreated whether to mark this queue as autoCreated or not
* @param maxConsumers how many concurrent consumers will be allowed on this queue * @param maxConsumers how many concurrent consumers will be allowed on this queue
* @param deleteOnNoConsumers whether to delete the queue when the last consumer disconnects * @param purgeOnNoConsumers whether to delete the contents of the queue when the last consumer disconnects
* @throws ActiveMQException * @throws ActiveMQException
*/ */
void createQueue(SimpleString address, RoutingType routingType, SimpleString queueName, SimpleString filter, void createQueue(SimpleString address, RoutingType routingType, SimpleString queueName, SimpleString filter,
boolean durable, boolean autoCreated, int maxConsumers, boolean deleteOnNoConsumers) throws ActiveMQException; boolean durable, boolean autoCreated, int maxConsumers, boolean purgeOnNoConsumers) throws ActiveMQException;
/** /**
* Creates a <em>non-temporary</em>queue. * Creates a <em>non-temporary</em>queue.
@ -553,11 +553,11 @@ public interface ClientSession extends XAResource, AutoCloseable {
* @param durable whether the queue is durable or not * @param durable whether the queue is durable or not
* @param autoCreated whether to mark this queue as autoCreated or not * @param autoCreated whether to mark this queue as autoCreated or not
* @param maxConsumers how many concurrent consumers will be allowed on this queue * @param maxConsumers how many concurrent consumers will be allowed on this queue
* @param deleteOnNoConsumers whether to delete the queue when the last consumer disconnects * @param purgeOnNoConsumers whether to delete the contents of the queue when the last consumer disconnects
* @throws ActiveMQException * @throws ActiveMQException
*/ */
void createQueue(String address, RoutingType routingType, String queueName, String filter, boolean durable, boolean autoCreated, void createQueue(String address, RoutingType routingType, String queueName, String filter, boolean durable, boolean autoCreated,
int maxConsumers, boolean deleteOnNoConsumers) throws ActiveMQException; int maxConsumers, boolean purgeOnNoConsumers) throws ActiveMQException;
/** /**
* Creates a <em>temporary</em> queue. * Creates a <em>temporary</em> queue.

View File

@ -565,7 +565,7 @@ public interface ActiveMQServerControl {
* @param filterStr filter of the queue * @param filterStr filter of the queue
* @param durable is the queue durable? * @param durable is the queue durable?
* @param maxConsumers the maximum number of consumers allowed on this queue at any one time * @param maxConsumers the maximum number of consumers allowed on this queue at any one time
* @param deleteOnNoConsumers delete this queue when the last consumer disconnects * @param purgeOnNoConsumers delete this queue when the last consumer disconnects
* @param autoCreateAddress create an address with default values should a matching address not be found * @param autoCreateAddress create an address with default values should a matching address not be found
* @return a textual summary of the queue * @return a textual summary of the queue
* @throws Exception * @throws Exception
@ -576,7 +576,7 @@ public interface ActiveMQServerControl {
@Parameter(name = "filter", desc = "Filter of the queue") String filterStr, @Parameter(name = "filter", desc = "Filter of the queue") String filterStr,
@Parameter(name = "durable", desc = "Is the queue durable?") boolean durable, @Parameter(name = "durable", desc = "Is the queue durable?") boolean durable,
@Parameter(name = "maxConsumers", desc = "The maximum number of consumers allowed on this queue at any one time") int maxConsumers, @Parameter(name = "maxConsumers", desc = "The maximum number of consumers allowed on this queue at any one time") int maxConsumers,
@Parameter(name = "deleteOnNoConsumers", desc = "Delete this queue when the last consumer disconnects") boolean deleteOnNoConsumers, @Parameter(name = "purgeOnNoConsumers", desc = "Delete this queue when the last consumer disconnects") boolean purgeOnNoConsumers,
@Parameter(name = "autoCreateAddress", desc = "Create an address with default values should a matching address not be found") boolean autoCreateAddress) throws Exception; @Parameter(name = "autoCreateAddress", desc = "Create an address with default values should a matching address not be found") boolean autoCreateAddress) throws Exception;
/** /**
@ -585,14 +585,14 @@ public interface ActiveMQServerControl {
* @param name name of the queue * @param name name of the queue
* @param routingType the routing type used for this address, {@code MULTICAST} or {@code ANYCAST} * @param routingType the routing type used for this address, {@code MULTICAST} or {@code ANYCAST}
* @param maxConsumers the maximum number of consumers allowed on this queue at any one time * @param maxConsumers the maximum number of consumers allowed on this queue at any one time
* @param deleteOnNoConsumers delete this queue when the last consumer disconnects * @param purgeOnNoConsumers delete this queue when the last consumer disconnects
* @return a textual summary of the queue * @return a textual summary of the queue
* @throws Exception * @throws Exception
*/ */
String updateQueue(@Parameter(name = "name", desc = "Name of the queue") String name, String updateQueue(@Parameter(name = "name", desc = "Name of the queue") String name,
@Parameter(name = "routingType", desc = "The routing type used for this address, MULTICAST or ANYCAST") String routingType, @Parameter(name = "routingType", desc = "The routing type used for this address, MULTICAST or ANYCAST") String routingType,
@Parameter(name = "maxConsumers", desc = "The maximum number of consumers allowed on this queue at any one time") Integer maxConsumers, @Parameter(name = "maxConsumers", desc = "The maximum number of consumers allowed on this queue at any one time") Integer maxConsumers,
@Parameter(name = "deleteOnNoConsumers", desc = "Delete this queue when the last consumer disconnects") Boolean deleteOnNoConsumers) throws Exception; @Parameter(name = "purgeOnNoConsumers", desc = "Delete this queue when the last consumer disconnects") Boolean purgeOnNoConsumers) throws Exception;

View File

@ -150,7 +150,7 @@ public interface QueueControl {
* *
*/ */
@Attribute(desc = "delete this queue when the last consumer disconnects") @Attribute(desc = "delete this queue when the last consumer disconnects")
boolean isDeleteOnNoConsumers(); boolean isPurgeOnNoConsumers();
// Operations ---------------------------------------------------- // Operations ----------------------------------------------------

View File

@ -32,7 +32,7 @@ public class AddressQueryImpl implements ClientSession.AddressQuery {
private final boolean autoCreateAddresses; private final boolean autoCreateAddresses;
private final boolean defaultDeleteOnNoConsumers; private final boolean defaultPurgeOnNoConsumers;
private final int defaultMaxConsumers; private final int defaultMaxConsumers;
@ -40,13 +40,13 @@ public class AddressQueryImpl implements ClientSession.AddressQuery {
final List<SimpleString> queueNames, final List<SimpleString> queueNames,
final boolean autoCreateQueues, final boolean autoCreateQueues,
final boolean autoCreateAddresses, final boolean autoCreateAddresses,
final boolean defaultDeleteOnNoConsumers, final boolean defaultPurgeOnNoConsumers,
final int defaultMaxConsumers) { final int defaultMaxConsumers) {
this.exists = exists; this.exists = exists;
this.queueNames = new ArrayList<>(queueNames); this.queueNames = new ArrayList<>(queueNames);
this.autoCreateQueues = autoCreateQueues; this.autoCreateQueues = autoCreateQueues;
this.autoCreateAddresses = autoCreateAddresses; this.autoCreateAddresses = autoCreateAddresses;
this.defaultDeleteOnNoConsumers = defaultDeleteOnNoConsumers; this.defaultPurgeOnNoConsumers = defaultPurgeOnNoConsumers;
this.defaultMaxConsumers = defaultMaxConsumers; this.defaultMaxConsumers = defaultMaxConsumers;
} }
@ -71,8 +71,8 @@ public class AddressQueryImpl implements ClientSession.AddressQuery {
} }
@Override @Override
public boolean isDefaultDeleteOnNoConsumers() { public boolean isDefaultPurgeOnNoConsumers() {
return defaultDeleteOnNoConsumers; return defaultPurgeOnNoConsumers;
} }
@Override @Override

View File

@ -368,7 +368,7 @@ public final class ClientSessionImpl implements ClientSessionInternal, FailureLi
durable, durable,
false, false,
ActiveMQDefaultConfiguration.getDefaultMaxQueueConsumers(), ActiveMQDefaultConfiguration.getDefaultMaxQueueConsumers(),
ActiveMQDefaultConfiguration.getDefaultDeleteQueueOnNoConsumers(), ActiveMQDefaultConfiguration.getDefaultPurgeOnNoConsumers(),
autoCreated); autoCreated);
} }
@ -385,20 +385,20 @@ public final class ClientSessionImpl implements ClientSessionInternal, FailureLi
@Override @Override
public void createQueue(final SimpleString address, final RoutingType routingType, final SimpleString queueName, final SimpleString filterString, public void createQueue(final SimpleString address, final RoutingType routingType, final SimpleString queueName, final SimpleString filterString,
final boolean durable, final boolean autoCreated, final int maxConsumers, final boolean deleteOnNoConsumers) throws ActiveMQException { final boolean durable, final boolean autoCreated, final int maxConsumers, final boolean purgeOnNoConsumers) throws ActiveMQException {
internalCreateQueue(address, internalCreateQueue(address,
queueName, routingType, queueName, routingType,
filterString, filterString,
durable, durable,
false, false,
maxConsumers, maxConsumers,
deleteOnNoConsumers, purgeOnNoConsumers,
autoCreated); autoCreated);
} }
@Override @Override
public void createQueue(final String address, final RoutingType routingType, final String queueName, final String filterString, public void createQueue(final String address, final RoutingType routingType, final String queueName, final String filterString,
final boolean durable, final boolean autoCreated, final int maxConsumers, final boolean deleteOnNoConsumers) throws ActiveMQException { final boolean durable, final boolean autoCreated, final int maxConsumers, final boolean purgeOnNoConsumers) throws ActiveMQException {
createQueue(SimpleString.toSimpleString(address), createQueue(SimpleString.toSimpleString(address),
routingType, routingType,
SimpleString.toSimpleString(queueName), SimpleString.toSimpleString(queueName),
@ -406,7 +406,7 @@ public final class ClientSessionImpl implements ClientSessionInternal, FailureLi
durable, durable,
autoCreated, autoCreated,
maxConsumers, maxConsumers,
deleteOnNoConsumers); purgeOnNoConsumers);
} }
@Override @Override
@ -432,7 +432,7 @@ public final class ClientSessionImpl implements ClientSessionInternal, FailureLi
false, false,
true, true,
ActiveMQDefaultConfiguration.getDefaultMaxQueueConsumers(), ActiveMQDefaultConfiguration.getDefaultMaxQueueConsumers(),
ActiveMQDefaultConfiguration.getDefaultDeleteQueueOnNoConsumers(), ActiveMQDefaultConfiguration.getDefaultPurgeOnNoConsumers(),
false); false);
} }
@ -458,7 +458,7 @@ public final class ClientSessionImpl implements ClientSessionInternal, FailureLi
durable, durable,
false, false,
ActiveMQDefaultConfiguration.getDefaultMaxQueueConsumers(), ActiveMQDefaultConfiguration.getDefaultMaxQueueConsumers(),
ActiveMQDefaultConfiguration.getDefaultDeleteQueueOnNoConsumers(), ActiveMQDefaultConfiguration.getDefaultPurgeOnNoConsumers(),
false); false);
} }
@ -533,7 +533,7 @@ public final class ClientSessionImpl implements ClientSessionInternal, FailureLi
false, false,
true, true,
ActiveMQDefaultConfiguration.getDefaultMaxQueueConsumers(), ActiveMQDefaultConfiguration.getDefaultMaxQueueConsumers(),
ActiveMQDefaultConfiguration.getDefaultDeleteQueueOnNoConsumers(), ActiveMQDefaultConfiguration.getDefaultPurgeOnNoConsumers(),
false); false);
} }
@ -554,7 +554,7 @@ public final class ClientSessionImpl implements ClientSessionInternal, FailureLi
false, false,
false, false,
ActiveMQDefaultConfiguration.getDefaultMaxQueueConsumers(), ActiveMQDefaultConfiguration.getDefaultMaxQueueConsumers(),
ActiveMQDefaultConfiguration.getDefaultDeleteQueueOnNoConsumers(), ActiveMQDefaultConfiguration.getDefaultPurgeOnNoConsumers(),
false); false);
} }
@ -578,7 +578,7 @@ public final class ClientSessionImpl implements ClientSessionInternal, FailureLi
durable, durable,
false, false,
ActiveMQDefaultConfiguration.getDefaultMaxQueueConsumers(), ActiveMQDefaultConfiguration.getDefaultMaxQueueConsumers(),
ActiveMQDefaultConfiguration.getDefaultDeleteQueueOnNoConsumers(), ActiveMQDefaultConfiguration.getDefaultPurgeOnNoConsumers(),
false); false);
} }
@ -1823,7 +1823,7 @@ public final class ClientSessionImpl implements ClientSessionInternal, FailureLi
final boolean durable, final boolean durable,
final boolean temp, final boolean temp,
final int maxConsumers, final int maxConsumers,
final boolean deleteOnNoConsumers, final boolean purgeOnNoConsumers,
final boolean autoCreated) throws ActiveMQException { final boolean autoCreated) throws ActiveMQException {
checkClosed(); checkClosed();
@ -1840,7 +1840,7 @@ public final class ClientSessionImpl implements ClientSessionInternal, FailureLi
durable, durable,
temp, temp,
maxConsumers, maxConsumers,
deleteOnNoConsumers, purgeOnNoConsumers,
autoCreated); autoCreated);
} finally { } finally {
endCall(); endCall();

View File

@ -44,7 +44,7 @@ public class QueueQueryImpl implements ClientSession.QueueQuery {
private final RoutingType routingType; private final RoutingType routingType;
private final boolean deleteOnNoConsumers; private final boolean purgeOnNoConsumers;
private final int maxConsumers; private final int maxConsumers;
@ -82,7 +82,7 @@ public class QueueQueryImpl implements ClientSession.QueueQuery {
final boolean autoCreateQueues, final boolean autoCreateQueues,
final int maxConsumers, final int maxConsumers,
final boolean autoCreated, final boolean autoCreated,
final boolean deleteOnNoConsumers, final boolean purgeOnNoConsumers,
final RoutingType routingType) { final RoutingType routingType) {
this.durable = durable; this.durable = durable;
this.temporary = temporary; this.temporary = temporary;
@ -95,7 +95,7 @@ public class QueueQueryImpl implements ClientSession.QueueQuery {
this.autoCreateQueues = autoCreateQueues; this.autoCreateQueues = autoCreateQueues;
this.maxConsumers = maxConsumers; this.maxConsumers = maxConsumers;
this.autoCreated = autoCreated; this.autoCreated = autoCreated;
this.deleteOnNoConsumers = deleteOnNoConsumers; this.purgeOnNoConsumers = purgeOnNoConsumers;
this.routingType = routingType; this.routingType = routingType;
} }
@ -155,8 +155,8 @@ public class QueueQueryImpl implements ClientSession.QueueQuery {
} }
@Override @Override
public boolean isDeleteOnNoConsumers() { public boolean isPurgeOnNoConsumers() {
return deleteOnNoConsumers; return purgeOnNoConsumers;
} }
@Override @Override

View File

@ -310,19 +310,19 @@ public class ActiveMQSessionContext extends SessionContext {
if (sessionChannel.supports(PacketImpl.SESS_BINDINGQUERY_RESP_V4, getServerVersion())) { if (sessionChannel.supports(PacketImpl.SESS_BINDINGQUERY_RESP_V4, getServerVersion())) {
Packet packet = sessionChannel.sendBlocking(new SessionBindingQueryMessage(address), PacketImpl.SESS_BINDINGQUERY_RESP_V4); Packet packet = sessionChannel.sendBlocking(new SessionBindingQueryMessage(address), PacketImpl.SESS_BINDINGQUERY_RESP_V4);
SessionBindingQueryResponseMessage_V4 response = (SessionBindingQueryResponseMessage_V4) packet; SessionBindingQueryResponseMessage_V4 response = (SessionBindingQueryResponseMessage_V4) packet;
return new AddressQueryImpl(response.isExists(), response.getQueueNames(), response.isAutoCreateQueues(), response.isAutoCreateAddresses(), response.isDefaultDeleteOnNoConsumers(), response.getDefaultMaxConsumers()); return new AddressQueryImpl(response.isExists(), response.getQueueNames(), response.isAutoCreateQueues(), response.isAutoCreateAddresses(), response.isDefaultPurgeOnNoConsumers(), response.getDefaultMaxConsumers());
} else if (sessionChannel.supports(PacketImpl.SESS_BINDINGQUERY_RESP_V3, getServerVersion())) { } else if (sessionChannel.supports(PacketImpl.SESS_BINDINGQUERY_RESP_V3, getServerVersion())) {
Packet packet = sessionChannel.sendBlocking(new SessionBindingQueryMessage(address), PacketImpl.SESS_BINDINGQUERY_RESP_V3); Packet packet = sessionChannel.sendBlocking(new SessionBindingQueryMessage(address), PacketImpl.SESS_BINDINGQUERY_RESP_V3);
SessionBindingQueryResponseMessage_V3 response = (SessionBindingQueryResponseMessage_V3) packet; SessionBindingQueryResponseMessage_V3 response = (SessionBindingQueryResponseMessage_V3) packet;
return new AddressQueryImpl(response.isExists(), response.getQueueNames(), response.isAutoCreateQueues(), response.isAutoCreateAddresses(), ActiveMQDefaultConfiguration.getDefaultDeleteQueueOnNoConsumers(), ActiveMQDefaultConfiguration.getDefaultMaxQueueConsumers()); return new AddressQueryImpl(response.isExists(), response.getQueueNames(), response.isAutoCreateQueues(), response.isAutoCreateAddresses(), ActiveMQDefaultConfiguration.getDefaultPurgeOnNoConsumers(), ActiveMQDefaultConfiguration.getDefaultMaxQueueConsumers());
} else if (sessionChannel.supports(PacketImpl.SESS_BINDINGQUERY_RESP_V2, getServerVersion())) { } else if (sessionChannel.supports(PacketImpl.SESS_BINDINGQUERY_RESP_V2, getServerVersion())) {
Packet packet = sessionChannel.sendBlocking(new SessionBindingQueryMessage(address), PacketImpl.SESS_BINDINGQUERY_RESP_V2); Packet packet = sessionChannel.sendBlocking(new SessionBindingQueryMessage(address), PacketImpl.SESS_BINDINGQUERY_RESP_V2);
SessionBindingQueryResponseMessage_V2 response = (SessionBindingQueryResponseMessage_V2) packet; SessionBindingQueryResponseMessage_V2 response = (SessionBindingQueryResponseMessage_V2) packet;
return new AddressQueryImpl(response.isExists(), response.getQueueNames(), response.isAutoCreateQueues(), false, ActiveMQDefaultConfiguration.getDefaultDeleteQueueOnNoConsumers(), ActiveMQDefaultConfiguration.getDefaultMaxQueueConsumers()); return new AddressQueryImpl(response.isExists(), response.getQueueNames(), response.isAutoCreateQueues(), false, ActiveMQDefaultConfiguration.getDefaultPurgeOnNoConsumers(), ActiveMQDefaultConfiguration.getDefaultMaxQueueConsumers());
} else { } else {
Packet packet = sessionChannel.sendBlocking(new SessionBindingQueryMessage(address), PacketImpl.SESS_BINDINGQUERY_RESP); Packet packet = sessionChannel.sendBlocking(new SessionBindingQueryMessage(address), PacketImpl.SESS_BINDINGQUERY_RESP);
SessionBindingQueryResponseMessage response = (SessionBindingQueryResponseMessage) packet; SessionBindingQueryResponseMessage response = (SessionBindingQueryResponseMessage) packet;
return new AddressQueryImpl(response.isExists(), response.getQueueNames(), false, false, ActiveMQDefaultConfiguration.getDefaultDeleteQueueOnNoConsumers(), ActiveMQDefaultConfiguration.getDefaultMaxQueueConsumers()); return new AddressQueryImpl(response.isExists(), response.getQueueNames(), false, false, ActiveMQDefaultConfiguration.getDefaultPurgeOnNoConsumers(), ActiveMQDefaultConfiguration.getDefaultMaxQueueConsumers());
} }
} }
@ -617,7 +617,7 @@ public class ActiveMQSessionContext extends SessionContext {
boolean durable, boolean durable,
boolean temp, boolean temp,
boolean autoCreated) throws ActiveMQException { boolean autoCreated) throws ActiveMQException {
createQueue(address, ActiveMQDefaultConfiguration.getDefaultRoutingType(), queueName, filterString, durable, temp, ActiveMQDefaultConfiguration.getDefaultMaxQueueConsumers(), ActiveMQDefaultConfiguration.getDefaultDeleteQueueOnNoConsumers(), autoCreated); createQueue(address, ActiveMQDefaultConfiguration.getDefaultRoutingType(), queueName, filterString, durable, temp, ActiveMQDefaultConfiguration.getDefaultMaxQueueConsumers(), ActiveMQDefaultConfiguration.getDefaultPurgeOnNoConsumers(), autoCreated);
} }
@Override @Override
@ -628,9 +628,9 @@ public class ActiveMQSessionContext extends SessionContext {
boolean durable, boolean durable,
boolean temp, boolean temp,
int maxConsumers, int maxConsumers,
boolean deleteOnNoConsumers, boolean purgeOnNoConsumers,
boolean autoCreated) throws ActiveMQException { boolean autoCreated) throws ActiveMQException {
CreateQueueMessage request = new CreateQueueMessage_V2(address, queueName, routingType, filterString, durable, temp, maxConsumers, deleteOnNoConsumers, autoCreated, true); CreateQueueMessage request = new CreateQueueMessage_V2(address, queueName, routingType, filterString, durable, temp, maxConsumers, purgeOnNoConsumers, autoCreated, true);
sessionChannel.sendBlocking(request, PacketImpl.NULL_RESPONSE); sessionChannel.sendBlocking(request, PacketImpl.NULL_RESPONSE);
} }
@ -715,7 +715,7 @@ public class ActiveMQSessionContext extends SessionContext {
// they are defined in broker.xml // they are defined in broker.xml
// This allows e.g. JMS non durable subs and temporary queues to continue to be used after failover // This allows e.g. JMS non durable subs and temporary queues to continue to be used after failover
if (!queueInfo.isDurable()) { if (!queueInfo.isDurable()) {
CreateQueueMessage_V2 createQueueRequest = new CreateQueueMessage_V2(queueInfo.getAddress(), queueInfo.getName(), queueInfo.getRoutingType(), queueInfo.getFilterString(), false, queueInfo.isTemporary(), queueInfo.getMaxConsumers(), queueInfo.isDeleteOnNoConsumers(), queueInfo.isAutoCreated(), false); CreateQueueMessage_V2 createQueueRequest = new CreateQueueMessage_V2(queueInfo.getAddress(), queueInfo.getName(), queueInfo.getRoutingType(), queueInfo.getFilterString(), false, queueInfo.isTemporary(), queueInfo.getMaxConsumers(), queueInfo.isPurgeOnNoConsumers(), queueInfo.isAutoCreated(), false);
sendPacketWithoutLock(sessionChannel, createQueueRequest); sendPacketWithoutLock(sessionChannel, createQueueRequest);
} }

View File

@ -28,7 +28,7 @@ public class CreateQueueMessage_V2 extends CreateQueueMessage {
private int maxConsumers; private int maxConsumers;
private boolean deleteOnNoConsumers; private boolean purgeOnNoConsumers;
public CreateQueueMessage_V2(final SimpleString address, public CreateQueueMessage_V2(final SimpleString address,
final SimpleString queueName, final SimpleString queueName,
@ -37,7 +37,7 @@ public class CreateQueueMessage_V2 extends CreateQueueMessage {
final boolean durable, final boolean durable,
final boolean temporary, final boolean temporary,
final int maxConsumers, final int maxConsumers,
final boolean deleteOnNoConsumers, final boolean purgeOnNoConsumers,
final boolean autoCreated, final boolean autoCreated,
final boolean requiresResponse) { final boolean requiresResponse) {
this(); this();
@ -51,7 +51,7 @@ public class CreateQueueMessage_V2 extends CreateQueueMessage {
this.requiresResponse = requiresResponse; this.requiresResponse = requiresResponse;
this.routingType = routingType; this.routingType = routingType;
this.maxConsumers = maxConsumers; this.maxConsumers = maxConsumers;
this.deleteOnNoConsumers = deleteOnNoConsumers; this.purgeOnNoConsumers = purgeOnNoConsumers;
} }
public CreateQueueMessage_V2() { public CreateQueueMessage_V2() {
@ -66,7 +66,7 @@ public class CreateQueueMessage_V2 extends CreateQueueMessage {
buff.append(", autoCreated=" + autoCreated); buff.append(", autoCreated=" + autoCreated);
buff.append(", routingType=" + routingType); buff.append(", routingType=" + routingType);
buff.append(", maxConsumers=" + maxConsumers); buff.append(", maxConsumers=" + maxConsumers);
buff.append(", deleteOnNoConsumers=" + deleteOnNoConsumers); buff.append(", purgeOnNoConsumers=" + purgeOnNoConsumers);
buff.append("]"); buff.append("]");
return buff.toString(); return buff.toString();
} }
@ -87,12 +87,12 @@ public class CreateQueueMessage_V2 extends CreateQueueMessage {
this.maxConsumers = maxConsumers; this.maxConsumers = maxConsumers;
} }
public boolean isDeleteOnNoConsumers() { public boolean isPurgeOnNoConsumers() {
return deleteOnNoConsumers; return purgeOnNoConsumers;
} }
public void setDeleteOnNoConsumers(boolean deleteOnNoConsumers) { public void setPurgeOnNoConsumers(boolean purgeOnNoConsumers) {
this.deleteOnNoConsumers = deleteOnNoConsumers; this.purgeOnNoConsumers = purgeOnNoConsumers;
} }
public boolean isAutoCreated() { public boolean isAutoCreated() {
@ -109,7 +109,7 @@ public class CreateQueueMessage_V2 extends CreateQueueMessage {
buffer.writeBoolean(autoCreated); buffer.writeBoolean(autoCreated);
buffer.writeByte(routingType == null ? -1 : routingType.getType()); buffer.writeByte(routingType == null ? -1 : routingType.getType());
buffer.writeInt(maxConsumers); buffer.writeInt(maxConsumers);
buffer.writeBoolean(deleteOnNoConsumers); buffer.writeBoolean(purgeOnNoConsumers);
} }
@Override @Override
@ -118,7 +118,7 @@ public class CreateQueueMessage_V2 extends CreateQueueMessage {
autoCreated = buffer.readBoolean(); autoCreated = buffer.readBoolean();
routingType = RoutingType.getType(buffer.readByte()); routingType = RoutingType.getType(buffer.readByte());
maxConsumers = buffer.readInt(); maxConsumers = buffer.readInt();
deleteOnNoConsumers = buffer.readBoolean(); purgeOnNoConsumers = buffer.readBoolean();
} }
@Override @Override
@ -128,7 +128,7 @@ public class CreateQueueMessage_V2 extends CreateQueueMessage {
result = prime * result + (autoCreated ? 1231 : 1237); result = prime * result + (autoCreated ? 1231 : 1237);
result = prime * result + (routingType.getType()); result = prime * result + (routingType.getType());
result = prime * result + (maxConsumers); result = prime * result + (maxConsumers);
result = prime * result + (deleteOnNoConsumers ? 1231 : 1237); result = prime * result + (purgeOnNoConsumers ? 1231 : 1237);
return result; return result;
} }
@ -145,9 +145,9 @@ public class CreateQueueMessage_V2 extends CreateQueueMessage {
return false; return false;
if (maxConsumers != other.maxConsumers) if (maxConsumers != other.maxConsumers)
return false; return false;
if (deleteOnNoConsumers != other.deleteOnNoConsumers) if (purgeOnNoConsumers != other.purgeOnNoConsumers)
return false; return false;
if (deleteOnNoConsumers != other.deleteOnNoConsumers) if (purgeOnNoConsumers != other.purgeOnNoConsumers)
return false; return false;
if (routingType == null) { if (routingType == null) {
if (other.routingType != null) if (other.routingType != null)

View File

@ -23,7 +23,7 @@ import org.apache.activemq.artemis.api.core.SimpleString;
public class SessionBindingQueryResponseMessage_V4 extends SessionBindingQueryResponseMessage_V3 { public class SessionBindingQueryResponseMessage_V4 extends SessionBindingQueryResponseMessage_V3 {
private boolean defaultDeleteOnNoConsumers; private boolean defaultPurgeOnNoConsumers;
private int defaultMaxConsumers; private int defaultMaxConsumers;
@ -31,7 +31,7 @@ public class SessionBindingQueryResponseMessage_V4 extends SessionBindingQueryRe
final List<SimpleString> queueNames, final List<SimpleString> queueNames,
final boolean autoCreateQueues, final boolean autoCreateQueues,
final boolean autoCreateAddresses, final boolean autoCreateAddresses,
final boolean defaultDeleteOnNoConsumers, final boolean defaultPurgeOnNoConsumers,
final int defaultMaxConsumers) { final int defaultMaxConsumers) {
super(SESS_BINDINGQUERY_RESP_V4); super(SESS_BINDINGQUERY_RESP_V4);
@ -43,7 +43,7 @@ public class SessionBindingQueryResponseMessage_V4 extends SessionBindingQueryRe
this.autoCreateAddresses = autoCreateAddresses; this.autoCreateAddresses = autoCreateAddresses;
this.defaultDeleteOnNoConsumers = defaultDeleteOnNoConsumers; this.defaultPurgeOnNoConsumers = defaultPurgeOnNoConsumers;
this.defaultMaxConsumers = defaultMaxConsumers; this.defaultMaxConsumers = defaultMaxConsumers;
} }
@ -52,8 +52,8 @@ public class SessionBindingQueryResponseMessage_V4 extends SessionBindingQueryRe
super(SESS_BINDINGQUERY_RESP_V4); super(SESS_BINDINGQUERY_RESP_V4);
} }
public boolean isDefaultDeleteOnNoConsumers() { public boolean isDefaultPurgeOnNoConsumers() {
return defaultDeleteOnNoConsumers; return defaultPurgeOnNoConsumers;
} }
public int getDefaultMaxConsumers() { public int getDefaultMaxConsumers() {
@ -63,14 +63,14 @@ public class SessionBindingQueryResponseMessage_V4 extends SessionBindingQueryRe
@Override @Override
public void encodeRest(final ActiveMQBuffer buffer) { public void encodeRest(final ActiveMQBuffer buffer) {
super.encodeRest(buffer); super.encodeRest(buffer);
buffer.writeBoolean(defaultDeleteOnNoConsumers); buffer.writeBoolean(defaultPurgeOnNoConsumers);
buffer.writeInt(defaultMaxConsumers); buffer.writeInt(defaultMaxConsumers);
} }
@Override @Override
public void decodeRest(final ActiveMQBuffer buffer) { public void decodeRest(final ActiveMQBuffer buffer) {
super.decodeRest(buffer); super.decodeRest(buffer);
defaultDeleteOnNoConsumers = buffer.readBoolean(); defaultPurgeOnNoConsumers = buffer.readBoolean();
defaultMaxConsumers = buffer.readInt(); defaultMaxConsumers = buffer.readInt();
} }
@ -78,7 +78,7 @@ public class SessionBindingQueryResponseMessage_V4 extends SessionBindingQueryRe
public int hashCode() { public int hashCode() {
final int prime = 31; final int prime = 31;
int result = super.hashCode(); int result = super.hashCode();
result = prime * result + (defaultDeleteOnNoConsumers ? 1231 : 1237); result = prime * result + (defaultPurgeOnNoConsumers ? 1231 : 1237);
result = prime * result + defaultMaxConsumers; result = prime * result + defaultMaxConsumers;
return result; return result;
} }
@ -93,7 +93,7 @@ public class SessionBindingQueryResponseMessage_V4 extends SessionBindingQueryRe
@Override @Override
public String getParentString() { public String getParentString() {
StringBuffer buff = new StringBuffer(super.getParentString()); StringBuffer buff = new StringBuffer(super.getParentString());
buff.append(", defaultDeleteOnNoConsumers=" + defaultDeleteOnNoConsumers); buff.append(", defaultPurgeOnNoConsumers=" + defaultPurgeOnNoConsumers);
buff.append(", defaultMaxConsumers=" + defaultMaxConsumers); buff.append(", defaultMaxConsumers=" + defaultMaxConsumers);
return buff.toString(); return buff.toString();
} }
@ -107,7 +107,7 @@ public class SessionBindingQueryResponseMessage_V4 extends SessionBindingQueryRe
if (!(obj instanceof SessionBindingQueryResponseMessage_V4)) if (!(obj instanceof SessionBindingQueryResponseMessage_V4))
return false; return false;
SessionBindingQueryResponseMessage_V4 other = (SessionBindingQueryResponseMessage_V4) obj; SessionBindingQueryResponseMessage_V4 other = (SessionBindingQueryResponseMessage_V4) obj;
if (defaultDeleteOnNoConsumers != other.defaultDeleteOnNoConsumers) if (defaultPurgeOnNoConsumers != other.defaultPurgeOnNoConsumers)
return false; return false;
if (defaultMaxConsumers != other.defaultMaxConsumers) if (defaultMaxConsumers != other.defaultMaxConsumers)
return false; return false;

View File

@ -27,14 +27,14 @@ public class SessionQueueQueryResponseMessage_V3 extends SessionQueueQueryRespon
protected boolean autoCreated; protected boolean autoCreated;
protected boolean deleteOnNoConsumers; protected boolean purgeOnNoConsumers;
protected RoutingType routingType; protected RoutingType routingType;
protected int maxConsumers; protected int maxConsumers;
public SessionQueueQueryResponseMessage_V3(final QueueQueryResult result) { public SessionQueueQueryResponseMessage_V3(final QueueQueryResult result) {
this(result.getName(), result.getAddress(), result.isDurable(), result.isTemporary(), result.getFilterString(), result.getConsumerCount(), result.getMessageCount(), result.isExists(), result.isAutoCreateQueues(), result.isAutoCreated(), result.isDeleteOnNoConsumers(), result.getRoutingType(), result.getMaxConsumers()); this(result.getName(), result.getAddress(), result.isDurable(), result.isTemporary(), result.getFilterString(), result.getConsumerCount(), result.getMessageCount(), result.isExists(), result.isAutoCreateQueues(), result.isAutoCreated(), result.isPurgeOnNoConsumers(), result.getRoutingType(), result.getMaxConsumers());
} }
public SessionQueueQueryResponseMessage_V3() { public SessionQueueQueryResponseMessage_V3() {
@ -51,7 +51,7 @@ public class SessionQueueQueryResponseMessage_V3 extends SessionQueueQueryRespon
final boolean exists, final boolean exists,
final boolean autoCreateQueues, final boolean autoCreateQueues,
final boolean autoCreated, final boolean autoCreated,
final boolean deleteOnNoConsumers, final boolean purgeOnNoConsumers,
final RoutingType routingType, final RoutingType routingType,
final int maxConsumers) { final int maxConsumers) {
super(SESS_QUEUEQUERY_RESP_V3); super(SESS_QUEUEQUERY_RESP_V3);
@ -76,7 +76,7 @@ public class SessionQueueQueryResponseMessage_V3 extends SessionQueueQueryRespon
this.autoCreated = autoCreated; this.autoCreated = autoCreated;
this.deleteOnNoConsumers = deleteOnNoConsumers; this.purgeOnNoConsumers = purgeOnNoConsumers;
this.routingType = routingType; this.routingType = routingType;
@ -91,12 +91,12 @@ public class SessionQueueQueryResponseMessage_V3 extends SessionQueueQueryRespon
this.autoCreated = autoCreated; this.autoCreated = autoCreated;
} }
public boolean isDeleteOnNoConsumers() { public boolean isPurgeOnNoConsumers() {
return deleteOnNoConsumers; return purgeOnNoConsumers;
} }
public void setDeleteOnNoConsumers(boolean deleteOnNoConsumers) { public void setPurgeOnNoConsumers(boolean purgeOnNoConsumers) {
this.deleteOnNoConsumers = deleteOnNoConsumers; this.purgeOnNoConsumers = purgeOnNoConsumers;
} }
public RoutingType getRoutingType() { public RoutingType getRoutingType() {
@ -119,7 +119,7 @@ public class SessionQueueQueryResponseMessage_V3 extends SessionQueueQueryRespon
public void encodeRest(final ActiveMQBuffer buffer) { public void encodeRest(final ActiveMQBuffer buffer) {
super.encodeRest(buffer); super.encodeRest(buffer);
buffer.writeBoolean(autoCreated); buffer.writeBoolean(autoCreated);
buffer.writeBoolean(deleteOnNoConsumers); buffer.writeBoolean(purgeOnNoConsumers);
buffer.writeByte(routingType.getType()); buffer.writeByte(routingType.getType());
buffer.writeInt(maxConsumers); buffer.writeInt(maxConsumers);
} }
@ -128,7 +128,7 @@ public class SessionQueueQueryResponseMessage_V3 extends SessionQueueQueryRespon
public void decodeRest(final ActiveMQBuffer buffer) { public void decodeRest(final ActiveMQBuffer buffer) {
super.decodeRest(buffer); super.decodeRest(buffer);
autoCreated = buffer.readBoolean(); autoCreated = buffer.readBoolean();
deleteOnNoConsumers = buffer.readBoolean(); purgeOnNoConsumers = buffer.readBoolean();
routingType = RoutingType.getType(buffer.readByte()); routingType = RoutingType.getType(buffer.readByte());
maxConsumers = buffer.readInt(); maxConsumers = buffer.readInt();
} }
@ -138,7 +138,7 @@ public class SessionQueueQueryResponseMessage_V3 extends SessionQueueQueryRespon
final int prime = 31; final int prime = 31;
int result = super.hashCode(); int result = super.hashCode();
result = prime * result + (autoCreated ? 1231 : 1237); result = prime * result + (autoCreated ? 1231 : 1237);
result = prime * result + (deleteOnNoConsumers ? 1231 : 1237); result = prime * result + (purgeOnNoConsumers ? 1231 : 1237);
result = prime * result + routingType.hashCode(); result = prime * result + routingType.hashCode();
result = prime * result + maxConsumers; result = prime * result + maxConsumers;
return result; return result;
@ -155,7 +155,7 @@ public class SessionQueueQueryResponseMessage_V3 extends SessionQueueQueryRespon
public String getParentString() { public String getParentString() {
StringBuffer buff = new StringBuffer(super.getParentString()); StringBuffer buff = new StringBuffer(super.getParentString());
buff.append(", autoCreated=" + autoCreated); buff.append(", autoCreated=" + autoCreated);
buff.append(", deleteOnNoConsumers=" + deleteOnNoConsumers); buff.append(", purgeOnNoConsumers=" + purgeOnNoConsumers);
buff.append(", routingType=" + routingType); buff.append(", routingType=" + routingType);
buff.append(", maxConsumers=" + maxConsumers); buff.append(", maxConsumers=" + maxConsumers);
return buff.toString(); return buff.toString();
@ -163,7 +163,7 @@ public class SessionQueueQueryResponseMessage_V3 extends SessionQueueQueryRespon
@Override @Override
public ClientSession.QueueQuery toQueueQuery() { public ClientSession.QueueQuery toQueueQuery() {
return new QueueQueryImpl(isDurable(), isTemporary(), getConsumerCount(), getMessageCount(), getFilterString(), getAddress(), getName(), isExists(), isAutoCreateQueues(), getMaxConsumers(), isAutoCreated(), isDeleteOnNoConsumers(), getRoutingType()); return new QueueQueryImpl(isDurable(), isTemporary(), getConsumerCount(), getMessageCount(), getFilterString(), getAddress(), getName(), isExists(), isAutoCreateQueues(), getMaxConsumers(), isAutoCreated(), isPurgeOnNoConsumers(), getRoutingType());
} }
@Override @Override
@ -177,7 +177,7 @@ public class SessionQueueQueryResponseMessage_V3 extends SessionQueueQueryRespon
SessionQueueQueryResponseMessage_V3 other = (SessionQueueQueryResponseMessage_V3) obj; SessionQueueQueryResponseMessage_V3 other = (SessionQueueQueryResponseMessage_V3) obj;
if (autoCreated != other.autoCreated) if (autoCreated != other.autoCreated)
return false; return false;
if (deleteOnNoConsumers != other.deleteOnNoConsumers) if (purgeOnNoConsumers != other.purgeOnNoConsumers)
return false; return false;
if (routingType == null) { if (routingType == null) {
if (other.routingType != null) if (other.routingType != null)

View File

@ -28,10 +28,10 @@ public class AddressQueryResult {
private final boolean autoCreated; private final boolean autoCreated;
private final boolean exists; private final boolean exists;
private final boolean autoCreateAddresses; private final boolean autoCreateAddresses;
private final boolean defaultDeleteOnNoConsumers; private final boolean defaultPurgeOnNoConsumers;
private final int defaultMaxConsumers; private final int defaultMaxConsumers;
public AddressQueryResult(SimpleString name, Set<RoutingType> routingTypes, long id, boolean autoCreated, boolean exists, boolean autoCreateAddresses, boolean defaultDeleteOnNoConsumers, int defaultMaxConsumers) { public AddressQueryResult(SimpleString name, Set<RoutingType> routingTypes, long id, boolean autoCreated, boolean exists, boolean autoCreateAddresses, boolean defaultPurgeOnNoConsumers, int defaultMaxConsumers) {
this.name = name; this.name = name;
this.routingTypes = routingTypes; this.routingTypes = routingTypes;
@ -40,7 +40,7 @@ public class AddressQueryResult {
this.autoCreated = autoCreated; this.autoCreated = autoCreated;
this.exists = exists; this.exists = exists;
this.autoCreateAddresses = autoCreateAddresses; this.autoCreateAddresses = autoCreateAddresses;
this.defaultDeleteOnNoConsumers = defaultDeleteOnNoConsumers; this.defaultPurgeOnNoConsumers = defaultPurgeOnNoConsumers;
this.defaultMaxConsumers = defaultMaxConsumers; this.defaultMaxConsumers = defaultMaxConsumers;
} }
@ -68,8 +68,8 @@ public class AddressQueryResult {
return autoCreateAddresses; return autoCreateAddresses;
} }
public boolean isDefaultDeleteOnNoConsumers() { public boolean isDefaultPurgeOnNoConsumers() {
return defaultDeleteOnNoConsumers; return defaultPurgeOnNoConsumers;
} }
public int getDefaultMaxConsumers() { public int getDefaultMaxConsumers() {

View File

@ -40,7 +40,7 @@ public class QueueQueryResult {
private boolean autoCreated; private boolean autoCreated;
private boolean deleteOnNoConsumers; private boolean purgeOnNoConsumers;
private RoutingType routingType; private RoutingType routingType;
@ -56,7 +56,7 @@ public class QueueQueryResult {
final boolean autoCreateQueues, final boolean autoCreateQueues,
final boolean exists, final boolean exists,
final boolean autoCreated, final boolean autoCreated,
final boolean deleteOnNoConsumers, final boolean purgeOnNoConsumers,
final RoutingType routingType, final RoutingType routingType,
final int maxConsumers) { final int maxConsumers) {
this.durable = durable; this.durable = durable;
@ -79,7 +79,7 @@ public class QueueQueryResult {
this.autoCreated = autoCreated; this.autoCreated = autoCreated;
this.deleteOnNoConsumers = deleteOnNoConsumers; this.purgeOnNoConsumers = purgeOnNoConsumers;
this.routingType = routingType; this.routingType = routingType;
@ -126,8 +126,8 @@ public class QueueQueryResult {
return autoCreated; return autoCreated;
} }
public boolean isDeleteOnNoConsumers() { public boolean isPurgeOnNoConsumers() {
return deleteOnNoConsumers; return purgeOnNoConsumers;
} }
public RoutingType getRoutingType() { public RoutingType getRoutingType() {

View File

@ -203,7 +203,7 @@ public abstract class SessionContext {
boolean durable, boolean durable,
boolean temp, boolean temp,
int maxConsumers, int maxConsumers,
boolean deleteOnNoConsumers, boolean purgeOnNoConsumers,
boolean autoCreated) throws ActiveMQException; boolean autoCreated) throws ActiveMQException;
public abstract ClientSession.QueueQuery queueQuery(SimpleString queueName) throws ActiveMQException; public abstract ClientSession.QueueQuery queueQuery(SimpleString queueName) throws ActiveMQException;

View File

@ -412,7 +412,7 @@ public class ActiveMQMessageProducer implements MessageProducer, QueueSender, To
// TODO is it right to use the address for the queue name here? // TODO is it right to use the address for the queue name here?
clientSession.createTemporaryQueue(address, RoutingType.ANYCAST, address); clientSession.createTemporaryQueue(address, RoutingType.ANYCAST, address);
} else { } else {
clientSession.createQueue(address, RoutingType.ANYCAST, address, null, true, true, query.getDefaultMaxConsumers(), query.isDefaultDeleteOnNoConsumers()); clientSession.createQueue(address, RoutingType.ANYCAST, address, null, true, true, query.getDefaultMaxConsumers(), query.isDefaultPurgeOnNoConsumers());
} }
} else if (!destination.isQueue() && query.isAutoCreateAddresses()) { } else if (!destination.isQueue() && query.isAutoCreateAddresses()) {
clientSession.createAddress(address, RoutingType.MULTICAST, true); clientSession.createAddress(address, RoutingType.MULTICAST, true);

View File

@ -303,9 +303,9 @@ public class ActiveMQSession implements QueueSession, TopicSession {
if (!response.isExists()) { if (!response.isExists()) {
try { try {
if (jbd.isQueue() && response.isAutoCreateQueues()) { if (jbd.isQueue() && response.isAutoCreateQueues()) {
// perhaps just relying on the broker to do it is simplest (i.e. deleteOnNoConsumers) // perhaps just relying on the broker to do it is simplest (i.e. purgeOnNoConsumers)
session.createAddress(jbd.getSimpleAddress(), RoutingType.ANYCAST, true); session.createAddress(jbd.getSimpleAddress(), RoutingType.ANYCAST, true);
session.createQueue(jbd.getSimpleAddress(), RoutingType.ANYCAST, jbd.getSimpleAddress(), null, true, true, response.getDefaultMaxConsumers(), response.isDefaultDeleteOnNoConsumers()); session.createQueue(jbd.getSimpleAddress(), RoutingType.ANYCAST, jbd.getSimpleAddress(), null, true, true, response.getDefaultMaxConsumers(), response.isDefaultPurgeOnNoConsumers());
} else if (!jbd.isQueue() && response.isAutoCreateAddresses()) { } else if (!jbd.isQueue() && response.isAutoCreateAddresses()) {
session.createAddress(jbd.getSimpleAddress(), RoutingType.MULTICAST, true); session.createAddress(jbd.getSimpleAddress(), RoutingType.MULTICAST, true);
} else { } else {
@ -667,7 +667,7 @@ public class ActiveMQSession implements QueueSession, TopicSession {
if (!response.isExists() || !response.getQueueNames().contains(dest.getSimpleAddress())) { if (!response.isExists() || !response.getQueueNames().contains(dest.getSimpleAddress())) {
if (response.isAutoCreateQueues()) { if (response.isAutoCreateQueues()) {
try { try {
session.createQueue(dest.getSimpleAddress(), RoutingType.ANYCAST, dest.getSimpleAddress(), null, true, true, response.getDefaultMaxConsumers(), response.isDefaultDeleteOnNoConsumers()); session.createQueue(dest.getSimpleAddress(), RoutingType.ANYCAST, dest.getSimpleAddress(), null, true, true, response.getDefaultMaxConsumers(), response.isDefaultPurgeOnNoConsumers());
} catch (ActiveMQQueueExistsException e) { } catch (ActiveMQQueueExistsException e) {
// The queue was created by another client/admin between the query check and send create queue packet // The queue was created by another client/admin between the query check and send create queue packet
} }
@ -724,7 +724,7 @@ public class ActiveMQSession implements QueueSession, TopicSession {
if (!subResponse.isExists()) { if (!subResponse.isExists()) {
// durable subscription queues are not technically considered to be auto-created // durable subscription queues are not technically considered to be auto-created
session.createQueue(dest.getSimpleAddress(), RoutingType.MULTICAST, queueName, coreFilterString, true, false, response.getDefaultMaxConsumers(), response.isDefaultDeleteOnNoConsumers()); session.createQueue(dest.getSimpleAddress(), RoutingType.MULTICAST, queueName, coreFilterString, true, false, response.getDefaultMaxConsumers(), response.isDefaultPurgeOnNoConsumers());
} else { } else {
// Already exists // Already exists
if (subResponse.getConsumerCount() > 0) { if (subResponse.getConsumerCount() > 0) {
@ -755,7 +755,7 @@ public class ActiveMQSession implements QueueSession, TopicSession {
session.deleteQueue(queueName); session.deleteQueue(queueName);
// Create the new one // Create the new one
session.createQueue(dest.getSimpleAddress(), RoutingType.MULTICAST, queueName, coreFilterString, true, false, response.getDefaultMaxConsumers(), response.isDefaultDeleteOnNoConsumers()); session.createQueue(dest.getSimpleAddress(), RoutingType.MULTICAST, queueName, coreFilterString, true, false, response.getDefaultMaxConsumers(), response.isDefaultPurgeOnNoConsumers());
} }
} }
@ -817,7 +817,7 @@ public class ActiveMQSession implements QueueSession, TopicSession {
AddressQuery response = session.addressQuery(new SimpleString(activeMQDestination.getAddress())); AddressQuery response = session.addressQuery(new SimpleString(activeMQDestination.getAddress()));
if (!response.isExists()) { if (!response.isExists()) {
if (response.isAutoCreateQueues()) { if (response.isAutoCreateQueues()) {
session.createQueue(activeMQDestination.getSimpleAddress(), RoutingType.ANYCAST, activeMQDestination.getSimpleAddress(), null, true, true, response.getDefaultMaxConsumers(), response.isDefaultDeleteOnNoConsumers()); session.createQueue(activeMQDestination.getSimpleAddress(), RoutingType.ANYCAST, activeMQDestination.getSimpleAddress(), null, true, true, response.getDefaultMaxConsumers(), response.isDefaultPurgeOnNoConsumers());
} else { } else {
throw new InvalidDestinationException("Destination " + activeMQDestination.getName() + " does not exist"); throw new InvalidDestinationException("Destination " + activeMQDestination.getName() + " does not exist");
} }

View File

@ -1078,7 +1078,7 @@ public class JMSServerManagerImpl implements JMSServerManager, ActivateCallback
server.addOrUpdateAddressInfo(new AddressInfo(SimpleString.toSimpleString(queueName)).addRoutingType(RoutingType.ANYCAST)); server.addOrUpdateAddressInfo(new AddressInfo(SimpleString.toSimpleString(queueName)).addRoutingType(RoutingType.ANYCAST));
AddressSettings as = server.getAddressSettingsRepository().getMatch(queueName); AddressSettings as = server.getAddressSettingsRepository().getMatch(queueName);
server.createQueue(SimpleString.toSimpleString(queueName), RoutingType.ANYCAST, SimpleString.toSimpleString(queueName), SimpleString.toSimpleString(coreFilterString), null, durable, false, true, false, false, as.getDefaultMaxConsumers(), as.isDefaultDeleteOnNoConsumers(), as.isAutoCreateAddresses()); server.createQueue(SimpleString.toSimpleString(queueName), RoutingType.ANYCAST, SimpleString.toSimpleString(queueName), SimpleString.toSimpleString(coreFilterString), null, durable, false, true, false, false, as.getDefaultMaxConsumers(), as.isDefaultPurgeOnNoConsumers(), as.isAutoCreateAddresses());
queues.put(queueName, ActiveMQDestination.createQueue(queueName)); queues.put(queueName, ActiveMQDestination.createQueue(queueName));

View File

@ -361,7 +361,7 @@ public class EmbeddedActiveMQResource extends ExternalResource {
boolean temporary = false; boolean temporary = false;
Queue queue = null; Queue queue = null;
try { try {
queue = server.getActiveMQServer().createQueue(address, RoutingType.MULTICAST, name, filter, isUseDurableQueue(), temporary, server.getActiveMQServer().getAddressSettingsRepository().getMatch(address.toString()).getDefaultMaxConsumers(), server.getActiveMQServer().getAddressSettingsRepository().getMatch(address.toString()).isDefaultDeleteOnNoConsumers(), true); queue = server.getActiveMQServer().createQueue(address, RoutingType.MULTICAST, name, filter, isUseDurableQueue(), temporary, server.getActiveMQServer().getAddressSettingsRepository().getMatch(address.toString()).getDefaultMaxConsumers(), server.getActiveMQServer().getAddressSettingsRepository().getMatch(address.toString()).isDefaultPurgeOnNoConsumers(), true);
} catch (Exception ex) { } catch (Exception ex) {
throw new EmbeddedActiveMQResourceException(String.format("Failed to create queue: queueName = %s, name = %s", address.toString(), name.toString()), ex); throw new EmbeddedActiveMQResourceException(String.format("Failed to create queue: queueName = %s, name = %s", address.toString(), name.toString()), ex);
} }

View File

@ -72,7 +72,7 @@ public class HornetQClientSessionContext extends ActiveMQSessionContext {
public ClientSession.AddressQuery addressQuery(final SimpleString address) throws ActiveMQException { public ClientSession.AddressQuery addressQuery(final SimpleString address) throws ActiveMQException {
SessionBindingQueryResponseMessage response = (SessionBindingQueryResponseMessage) getSessionChannel().sendBlocking(new SessionBindingQueryMessage(address), PacketImpl.SESS_BINDINGQUERY_RESP); SessionBindingQueryResponseMessage response = (SessionBindingQueryResponseMessage) getSessionChannel().sendBlocking(new SessionBindingQueryMessage(address), PacketImpl.SESS_BINDINGQUERY_RESP);
return new AddressQueryImpl(response.isExists(), response.getQueueNames(), false, false, ActiveMQDefaultConfiguration.getDefaultDeleteQueueOnNoConsumers(), ActiveMQDefaultConfiguration.getDefaultMaxQueueConsumers()); return new AddressQueryImpl(response.isExists(), response.getQueueNames(), false, false, ActiveMQDefaultConfiguration.getDefaultPurgeOnNoConsumers(), ActiveMQDefaultConfiguration.getDefaultMaxQueueConsumers());
} }
@Override @Override

View File

@ -35,7 +35,7 @@ public class CoreQueueConfiguration implements Serializable {
private Integer maxConsumers = ActiveMQDefaultConfiguration.getDefaultMaxQueueConsumers(); private Integer maxConsumers = ActiveMQDefaultConfiguration.getDefaultMaxQueueConsumers();
private Boolean deleteOnNoConsumers = ActiveMQDefaultConfiguration.getDefaultDeleteQueueOnNoConsumers(); private Boolean purgeOnNoConsumers = ActiveMQDefaultConfiguration.getDefaultPurgeOnNoConsumers();
private RoutingType routingType = ActiveMQDefaultConfiguration.getDefaultRoutingType(); private RoutingType routingType = ActiveMQDefaultConfiguration.getDefaultRoutingType();
@ -99,15 +99,15 @@ public class CoreQueueConfiguration implements Serializable {
} }
/** /**
* @param deleteOnNoConsumers delete this queue when consumer count reaches 0, default is false * @param purgeOnNoConsumers delete this queue when consumer count reaches 0, default is false
*/ */
public CoreQueueConfiguration setDeleteOnNoConsumers(Boolean deleteOnNoConsumers) { public CoreQueueConfiguration setPurgeOnNoConsumers(Boolean purgeOnNoConsumers) {
this.deleteOnNoConsumers = deleteOnNoConsumers; this.purgeOnNoConsumers = purgeOnNoConsumers;
return this; return this;
} }
public boolean getDeleteOnNoConsumers() { public boolean getPurgeOnNoConsumers() {
return deleteOnNoConsumers; return purgeOnNoConsumers;
} }
public int getMaxConsumers() { public int getMaxConsumers() {
@ -132,7 +132,7 @@ public class CoreQueueConfiguration implements Serializable {
result = prime * result + ((filterString == null) ? 0 : filterString.hashCode()); result = prime * result + ((filterString == null) ? 0 : filterString.hashCode());
result = prime * result + ((name == null) ? 0 : name.hashCode()); result = prime * result + ((name == null) ? 0 : name.hashCode());
result = prime * result + ((maxConsumers == null) ? 0 : maxConsumers.hashCode()); result = prime * result + ((maxConsumers == null) ? 0 : maxConsumers.hashCode());
result = prime * result + ((deleteOnNoConsumers == null) ? 0 : deleteOnNoConsumers.hashCode()); result = prime * result + ((purgeOnNoConsumers == null) ? 0 : purgeOnNoConsumers.hashCode());
return result; return result;
} }
@ -167,10 +167,10 @@ public class CoreQueueConfiguration implements Serializable {
return false; return false;
} else if (!maxConsumers.equals(other.maxConsumers)) } else if (!maxConsumers.equals(other.maxConsumers))
return false; return false;
if (deleteOnNoConsumers == null) { if (purgeOnNoConsumers == null) {
if (other.deleteOnNoConsumers != null) if (other.purgeOnNoConsumers != null)
return false; return false;
} else if (!deleteOnNoConsumers.equals(other.deleteOnNoConsumers)) { } else if (!purgeOnNoConsumers.equals(other.purgeOnNoConsumers)) {
return false; return false;
} }
return true; return true;

View File

@ -185,7 +185,7 @@ public final class FileConfigurationParser extends XMLConfigurationUtil {
private static final String AUTO_DELETE_ADDRESSES = "auto-delete-addresses"; private static final String AUTO_DELETE_ADDRESSES = "auto-delete-addresses";
private static final String DEFAULT_DELETE_ON_NO_CONSUMERS = "default-delete-on-no-consumers"; private static final String DEFAULT_PURGE_ON_NO_CONSUMERS = "default-purge-on-no-consumers";
private static final String DEFAULT_MAX_CONSUMERS = "default-max-consumers"; private static final String DEFAULT_MAX_CONSUMERS = "default-max-consumers";
@ -889,8 +889,8 @@ public final class FileConfigurationParser extends XMLConfigurationUtil {
addressSettings.setAutoDeleteAddresses(XMLUtil.parseBoolean(child)); addressSettings.setAutoDeleteAddresses(XMLUtil.parseBoolean(child));
} else if (MANAGEMENT_BROWSE_PAGE_SIZE.equalsIgnoreCase(name)) { } else if (MANAGEMENT_BROWSE_PAGE_SIZE.equalsIgnoreCase(name)) {
addressSettings.setManagementBrowsePageSize(XMLUtil.parseInt(child)); addressSettings.setManagementBrowsePageSize(XMLUtil.parseInt(child));
} else if (DEFAULT_DELETE_ON_NO_CONSUMERS.equalsIgnoreCase(name)) { } else if (DEFAULT_PURGE_ON_NO_CONSUMERS.equalsIgnoreCase(name)) {
addressSettings.setDefaultDeleteOnNoConsumers(XMLUtil.parseBoolean(child)); addressSettings.setDefaultPurgeOnNoConsumers(XMLUtil.parseBoolean(child));
} else if (DEFAULT_MAX_CONSUMERS.equalsIgnoreCase(name)) { } else if (DEFAULT_MAX_CONSUMERS.equalsIgnoreCase(name)) {
addressSettings.setDefaultMaxConsumers(XMLUtil.parseInt(child)); addressSettings.setDefaultMaxConsumers(XMLUtil.parseInt(child));
} else if (DEFAULT_QUEUE_ROUTING_TYPE.equalsIgnoreCase(name)) { } else if (DEFAULT_QUEUE_ROUTING_TYPE.equalsIgnoreCase(name)) {
@ -937,7 +937,7 @@ public final class FileConfigurationParser extends XMLConfigurationUtil {
String filterString = null; String filterString = null;
boolean durable = true; boolean durable = true;
int maxConsumers = ActiveMQDefaultConfiguration.getDefaultMaxQueueConsumers(); int maxConsumers = ActiveMQDefaultConfiguration.getDefaultMaxQueueConsumers();
boolean deleteOnNoConsumers = ActiveMQDefaultConfiguration.getDefaultDeleteQueueOnNoConsumers(); boolean purgeOnNoConsumers = ActiveMQDefaultConfiguration.getDefaultPurgeOnNoConsumers();
NamedNodeMap attributes = node.getAttributes(); NamedNodeMap attributes = node.getAttributes();
for (int i = 0; i < attributes.getLength(); i++) { for (int i = 0; i < attributes.getLength(); i++) {
@ -945,8 +945,8 @@ public final class FileConfigurationParser extends XMLConfigurationUtil {
if (item.getNodeName().equals("max-consumers")) { if (item.getNodeName().equals("max-consumers")) {
maxConsumers = Integer.parseInt(item.getNodeValue()); maxConsumers = Integer.parseInt(item.getNodeValue());
Validators.MAX_QUEUE_CONSUMERS.validate(name, maxConsumers); Validators.MAX_QUEUE_CONSUMERS.validate(name, maxConsumers);
} else if (item.getNodeName().equals("delete-on-no-consumers")) { } else if (item.getNodeName().equals("purge-on-no-consumers")) {
deleteOnNoConsumers = Boolean.parseBoolean(item.getNodeValue()); purgeOnNoConsumers = Boolean.parseBoolean(item.getNodeValue());
} }
} }
@ -963,7 +963,7 @@ public final class FileConfigurationParser extends XMLConfigurationUtil {
} }
} }
return new CoreQueueConfiguration().setAddress(address).setName(name).setFilterString(filterString).setDurable(durable).setMaxConsumers(maxConsumers).setDeleteOnNoConsumers(deleteOnNoConsumers); return new CoreQueueConfiguration().setAddress(address).setName(name).setFilterString(filterString).setDurable(durable).setMaxConsumers(maxConsumers).setPurgeOnNoConsumers(purgeOnNoConsumers);
} }
protected CoreAddressConfiguration parseAddressConfiguration(final Node node) { protected CoreAddressConfiguration parseAddressConfiguration(final Node node) {

View File

@ -605,7 +605,7 @@ public class ActiveMQServerControlImpl extends AbstractControl implements Active
if (maxConsumers != Queue.MAX_CONSUMERS_UNLIMITED) { if (maxConsumers != Queue.MAX_CONSUMERS_UNLIMITED) {
output.append(", maxConsumers=").append(queue.getMaxConsumers()); output.append(", maxConsumers=").append(queue.getMaxConsumers());
} }
output.append(", deleteOnNoConsumers=").append(queue.isDeleteOnNoConsumers()); output.append(", purgeOnNoConsumers=").append(queue.isPurgeOnNoConsumers());
output.append(", autoCreateAddress=").append(queue.isAutoCreated()); output.append(", autoCreateAddress=").append(queue.isAutoCreated());
output.append(']'); output.append(']');
return output; return output;
@ -725,7 +725,7 @@ public class ActiveMQServerControlImpl extends AbstractControl implements Active
@Override @Override
public void createQueue(final String address, final String name, final String filterStr, final boolean durable, final String routingType) throws Exception { public void createQueue(final String address, final String name, final String filterStr, final boolean durable, final String routingType) throws Exception {
AddressSettings addressSettings = server.getAddressSettingsRepository().getMatch(address); AddressSettings addressSettings = server.getAddressSettingsRepository().getMatch(address);
createQueue(address, routingType, name, filterStr, durable, addressSettings.getDefaultMaxConsumers(), addressSettings.isDefaultDeleteOnNoConsumers(), addressSettings.isAutoCreateAddresses()); createQueue(address, routingType, name, filterStr, durable, addressSettings.getDefaultMaxConsumers(), addressSettings.isDefaultPurgeOnNoConsumers(), addressSettings.isAutoCreateAddresses());
} }
@Override @Override
@ -735,7 +735,7 @@ public class ActiveMQServerControlImpl extends AbstractControl implements Active
String filterStr, String filterStr,
boolean durable, boolean durable,
int maxConsumers, int maxConsumers,
boolean deleteOnNoConsumers, boolean purgeOnNoConsumers,
boolean autoCreateAddress) throws Exception { boolean autoCreateAddress) throws Exception {
checkStarted(); checkStarted();
@ -747,7 +747,7 @@ public class ActiveMQServerControlImpl extends AbstractControl implements Active
filter = new SimpleString(filterStr); filter = new SimpleString(filterStr);
} }
final Queue queue = server.createQueue(SimpleString.toSimpleString(address), RoutingType.valueOf(routingType.toUpperCase()), new SimpleString(name), filter, durable, false, maxConsumers, deleteOnNoConsumers, autoCreateAddress); final Queue queue = server.createQueue(SimpleString.toSimpleString(address), RoutingType.valueOf(routingType.toUpperCase()), new SimpleString(name), filter, durable, false, maxConsumers, purgeOnNoConsumers, autoCreateAddress);
return QueueTextFormatter.Long.format(queue, new StringBuilder()).toString(); return QueueTextFormatter.Long.format(queue, new StringBuilder()).toString();
} finally { } finally {
blockOnIO(); blockOnIO();
@ -758,13 +758,13 @@ public class ActiveMQServerControlImpl extends AbstractControl implements Active
public String updateQueue(String name, public String updateQueue(String name,
String routingType, String routingType,
Integer maxConsumers, Integer maxConsumers,
Boolean deleteOnNoConsumers) throws Exception { Boolean purgeOnNoConsumers) throws Exception {
checkStarted(); checkStarted();
clearIO(); clearIO();
try { try {
final Queue queue = server.updateQueue(name, routingType != null ? RoutingType.valueOf(routingType) : null, maxConsumers, deleteOnNoConsumers); final Queue queue = server.updateQueue(name, routingType != null ? RoutingType.valueOf(routingType) : null, maxConsumers, purgeOnNoConsumers);
if (queue == null) { if (queue == null) {
throw ActiveMQMessageBundle.BUNDLE.noSuchQueue(new SimpleString(name)); throw ActiveMQMessageBundle.BUNDLE.noSuchQueue(new SimpleString(name));
} }

View File

@ -344,12 +344,12 @@ public class QueueControlImpl extends AbstractControl implements QueueControl {
} }
@Override @Override
public boolean isDeleteOnNoConsumers() { public boolean isPurgeOnNoConsumers() {
checkStarted(); checkStarted();
clearIO(); clearIO();
try { try {
return queue.isDeleteOnNoConsumers(); return queue.isPurgeOnNoConsumers();
} finally { } finally {
blockOnIO(); blockOnIO();
} }

View File

@ -50,9 +50,9 @@ public interface QueueBindingInfo {
void setMaxConsumers(int maxConsumers); void setMaxConsumers(int maxConsumers);
boolean isDeleteOnNoConsumers(); boolean isPurgeOnNoConsumers();
void setDeleteOnNoConsumers(boolean deleteOnNoConsumers); void setPurgeOnNoConsumers(boolean purgeOnNoConsumers);
byte getRoutingType(); byte getRoutingType();

View File

@ -1221,7 +1221,7 @@ public abstract class AbstractJournalStorageManager implements StorageManager {
SimpleString filterString = filter == null ? null : filter.getFilterString(); SimpleString filterString = filter == null ? null : filter.getFilterString();
PersistentQueueBindingEncoding bindingEncoding = new PersistentQueueBindingEncoding(queue.getName(), binding.getAddress(), filterString, queue.getUser(), queue.isAutoCreated(), queue.getMaxConsumers(), queue.isDeleteOnNoConsumers(), queue.getRoutingType().getType()); PersistentQueueBindingEncoding bindingEncoding = new PersistentQueueBindingEncoding(queue.getName(), binding.getAddress(), filterString, queue.getUser(), queue.isAutoCreated(), queue.getMaxConsumers(), queue.isPurgeOnNoConsumers(), queue.getRoutingType().getType());
readLock(); readLock();
try { try {

View File

@ -44,7 +44,7 @@ public class PersistentQueueBindingEncoding implements EncodingSupport, QueueBin
public int maxConsumers; public int maxConsumers;
public boolean deleteOnNoConsumers; public boolean purgeOnNoConsumers;
public byte routingType; public byte routingType;
@ -66,8 +66,8 @@ public class PersistentQueueBindingEncoding implements EncodingSupport, QueueBin
autoCreated + autoCreated +
", maxConsumers=" + ", maxConsumers=" +
maxConsumers + maxConsumers +
", deleteOnNoConsumers=" + ", purgeOnNoConsumers=" +
deleteOnNoConsumers + purgeOnNoConsumers +
", routingType=" + ", routingType=" +
routingType + routingType +
"]"; "]";
@ -79,7 +79,7 @@ public class PersistentQueueBindingEncoding implements EncodingSupport, QueueBin
final SimpleString user, final SimpleString user,
final boolean autoCreated, final boolean autoCreated,
final int maxConsumers, final int maxConsumers,
final boolean deleteOnNoConsumers, final boolean purgeOnNoConsumers,
final byte routingType) { final byte routingType) {
this.name = name; this.name = name;
this.address = address; this.address = address;
@ -87,7 +87,7 @@ public class PersistentQueueBindingEncoding implements EncodingSupport, QueueBin
this.user = user; this.user = user;
this.autoCreated = autoCreated; this.autoCreated = autoCreated;
this.maxConsumers = maxConsumers; this.maxConsumers = maxConsumers;
this.deleteOnNoConsumers = deleteOnNoConsumers; this.purgeOnNoConsumers = purgeOnNoConsumers;
this.routingType = routingType; this.routingType = routingType;
} }
@ -154,13 +154,13 @@ public class PersistentQueueBindingEncoding implements EncodingSupport, QueueBin
} }
@Override @Override
public boolean isDeleteOnNoConsumers() { public boolean isPurgeOnNoConsumers() {
return false; return false;
} }
@Override @Override
public void setDeleteOnNoConsumers(boolean deleteOnNoConsumers) { public void setPurgeOnNoConsumers(boolean purgeOnNoConsumers) {
this.deleteOnNoConsumers = deleteOnNoConsumers; this.purgeOnNoConsumers = purgeOnNoConsumers;
} }
@Override @Override
@ -196,11 +196,11 @@ public class PersistentQueueBindingEncoding implements EncodingSupport, QueueBin
if (buffer.readableBytes() > 0) { if (buffer.readableBytes() > 0) {
maxConsumers = buffer.readInt(); maxConsumers = buffer.readInt();
deleteOnNoConsumers = buffer.readBoolean(); purgeOnNoConsumers = buffer.readBoolean();
routingType = buffer.readByte(); routingType = buffer.readByte();
} else { } else {
maxConsumers = ActiveMQDefaultConfiguration.getDefaultMaxQueueConsumers(); maxConsumers = ActiveMQDefaultConfiguration.getDefaultMaxQueueConsumers();
deleteOnNoConsumers = ActiveMQDefaultConfiguration.getDefaultDeleteQueueOnNoConsumers(); purgeOnNoConsumers = ActiveMQDefaultConfiguration.getDefaultPurgeOnNoConsumers();
routingType = ActiveMQDefaultConfiguration.getDefaultRoutingType().getType(); routingType = ActiveMQDefaultConfiguration.getDefaultRoutingType().getType();
} }
} }
@ -213,7 +213,7 @@ public class PersistentQueueBindingEncoding implements EncodingSupport, QueueBin
buffer.writeNullableSimpleString(createMetadata()); buffer.writeNullableSimpleString(createMetadata());
buffer.writeBoolean(autoCreated); buffer.writeBoolean(autoCreated);
buffer.writeInt(maxConsumers); buffer.writeInt(maxConsumers);
buffer.writeBoolean(deleteOnNoConsumers); buffer.writeBoolean(purgeOnNoConsumers);
buffer.writeByte(routingType); buffer.writeByte(routingType);
} }

View File

@ -60,7 +60,7 @@ public interface PostOffice extends ActiveMQComponent {
QueueBinding updateQueue(SimpleString name, QueueBinding updateQueue(SimpleString name,
RoutingType routingType, RoutingType routingType,
Integer maxConsumers, Integer maxConsumers,
Boolean deleteOnNoConsumers) throws Exception; Boolean purgeOnNoConsumers) throws Exception;
List<Queue> listQueuesForAddress(SimpleString address) throws Exception; List<Queue> listQueuesForAddress(SimpleString address) throws Exception;

View File

@ -444,7 +444,7 @@ public class PostOfficeImpl implements PostOffice, NotificationListener, Binding
public QueueBinding updateQueue(SimpleString name, public QueueBinding updateQueue(SimpleString name,
RoutingType routingType, RoutingType routingType,
Integer maxConsumers, Integer maxConsumers,
Boolean deleteOnNoConsumers) throws Exception { Boolean purgeOnNoConsumers) throws Exception {
synchronized (addressLock) { synchronized (addressLock) {
final QueueBinding queueBinding = (QueueBinding) addressManager.getBinding(name); final QueueBinding queueBinding = (QueueBinding) addressManager.getBinding(name);
if (queueBinding == null) { if (queueBinding == null) {
@ -474,8 +474,8 @@ public class PostOfficeImpl implements PostOffice, NotificationListener, Binding
if (routingType != null) { if (routingType != null) {
queue.setRoutingType(routingType); queue.setRoutingType(routingType);
} }
if (deleteOnNoConsumers != null) { if (purgeOnNoConsumers != null) {
queue.setDeleteOnNoConsumers(deleteOnNoConsumers); queue.setPurgeOnNoConsumers(purgeOnNoConsumers);
} }
return queueBinding; return queueBinding;
} }

View File

@ -252,7 +252,7 @@ public class ServerSessionPacketHandler implements ChannelHandler {
case CREATE_QUEUE_V2: { case CREATE_QUEUE_V2: {
CreateQueueMessage_V2 request = (CreateQueueMessage_V2) packet; CreateQueueMessage_V2 request = (CreateQueueMessage_V2) packet;
requiresResponse = request.isRequiresResponse(); requiresResponse = request.isRequiresResponse();
session.createQueue(request.getAddress(), request.getQueueName(), request.getRoutingType(), request.getFilterString(), request.isTemporary(), request.isDurable(), request.getMaxConsumers(), request.isDeleteOnNoConsumers(), session.createQueue(request.getAddress(), request.getQueueName(), request.getRoutingType(), request.getFilterString(), request.isTemporary(), request.isDurable(), request.getMaxConsumers(), request.isPurgeOnNoConsumers(),
request.isAutoCreated()); request.isAutoCreated());
if (requiresResponse) { if (requiresResponse) {
response = new NullResponseMessage(); response = new NullResponseMessage();
@ -302,7 +302,7 @@ public class ServerSessionPacketHandler implements ChannelHandler {
SessionBindingQueryMessage request = (SessionBindingQueryMessage) packet; SessionBindingQueryMessage request = (SessionBindingQueryMessage) packet;
BindingQueryResult result = session.executeBindingQuery(request.getAddress(remotingConnection.getClientVersion())); BindingQueryResult result = session.executeBindingQuery(request.getAddress(remotingConnection.getClientVersion()));
if (channel.supports(PacketImpl.SESS_BINDINGQUERY_RESP_V4)) { if (channel.supports(PacketImpl.SESS_BINDINGQUERY_RESP_V4)) {
response = new SessionBindingQueryResponseMessage_V4(result.isExists(), result.getQueueNames(), result.isAutoCreateQueues(), result.isAutoCreateAddresses(), result.isDefaultDeleteOnNoConsumers(), result.getDefaultMaxConsumers()); response = new SessionBindingQueryResponseMessage_V4(result.isExists(), result.getQueueNames(), result.isAutoCreateQueues(), result.isAutoCreateAddresses(), result.isDefaultPurgeOnNoConsumers(), result.getDefaultMaxConsumers());
} else if (channel.supports(PacketImpl.SESS_BINDINGQUERY_RESP_V3)) { } else if (channel.supports(PacketImpl.SESS_BINDINGQUERY_RESP_V3)) {
response = new SessionBindingQueryResponseMessage_V3(result.isExists(), result.getQueueNames(), result.isAutoCreateQueues(), result.isAutoCreateAddresses()); response = new SessionBindingQueryResponseMessage_V3(result.isExists(), result.getQueueNames(), result.isAutoCreateQueues(), result.isAutoCreateAddresses());
} else if (channel.supports(PacketImpl.SESS_BINDINGQUERY_RESP_V2)) { } else if (channel.supports(PacketImpl.SESS_BINDINGQUERY_RESP_V2)) {

View File

@ -287,16 +287,16 @@ public interface ActiveMQServer extends ActiveMQComponent {
boolean durable, boolean temporary) throws Exception; boolean durable, boolean temporary) throws Exception;
Queue createQueue(SimpleString address, RoutingType routingType, SimpleString queueName, SimpleString filter, Queue createQueue(SimpleString address, RoutingType routingType, SimpleString queueName, SimpleString filter,
boolean durable, boolean temporary, int maxConsumers, boolean deleteOnNoConsumers, boolean durable, boolean temporary, int maxConsumers, boolean purgeOnNoConsumers,
boolean autoCreateAddress) throws Exception; boolean autoCreateAddress) throws Exception;
Queue createQueue(SimpleString address, RoutingType routingType, SimpleString queueName, SimpleString filter, Queue createQueue(SimpleString address, RoutingType routingType, SimpleString queueName, SimpleString filter,
SimpleString user, boolean durable, boolean temporary, boolean autoCreated, Integer maxConsumers, SimpleString user, boolean durable, boolean temporary, boolean autoCreated, Integer maxConsumers,
Boolean deleteOnNoConsumers, boolean autoCreateAddress) throws Exception; Boolean purgeOnNoConsumers, boolean autoCreateAddress) throws Exception;
Queue createQueue(SimpleString address, RoutingType routingType, SimpleString queueName, SimpleString filter, Queue createQueue(SimpleString address, RoutingType routingType, SimpleString queueName, SimpleString filter,
SimpleString user, boolean durable, boolean temporary, boolean ignoreIfExists, boolean transientQueue, SimpleString user, boolean durable, boolean temporary, boolean ignoreIfExists, boolean transientQueue,
boolean autoCreated, int maxConsumers, boolean deleteOnNoConsumers, boolean autoCreateAddress) throws Exception; boolean autoCreated, int maxConsumers, boolean purgeOnNoConsumers, boolean autoCreateAddress) throws Exception;
@Deprecated @Deprecated
Queue createQueue(SimpleString address, SimpleString queueName, SimpleString filter, boolean durable, boolean temporary) throws Exception; Queue createQueue(SimpleString address, SimpleString queueName, SimpleString filter, boolean durable, boolean temporary) throws Exception;
@ -367,7 +367,7 @@ public interface ActiveMQServer extends ActiveMQComponent {
Queue updateQueue(String name, Queue updateQueue(String name,
RoutingType routingType, RoutingType routingType,
Integer maxConsumers, Integer maxConsumers,
Boolean deleteOnNoConsumers) throws Exception; Boolean purgeOnNoConsumers) throws Exception;
/* /*
* add a ProtocolManagerFactory to be used. Note if @see Configuration#isResolveProtocols is tur then this factory will * add a ProtocolManagerFactory to be used. Note if @see Configuration#isResolveProtocols is tur then this factory will

View File

@ -30,7 +30,7 @@ public class BindingQueryResult {
private boolean autoCreateAddresses; private boolean autoCreateAddresses;
private boolean defaultDeleteOnNoConsumers; private boolean defaultPurgeOnNoConsumers;
private int defaultMaxConsumers; private int defaultMaxConsumers;
@ -38,7 +38,7 @@ public class BindingQueryResult {
final List<SimpleString> queueNames, final List<SimpleString> queueNames,
final boolean autoCreateQueues, final boolean autoCreateQueues,
final boolean autoCreateAddresses, final boolean autoCreateAddresses,
final boolean defaultDeleteOnNoConsumers, final boolean defaultPurgeOnNoConsumers,
final int defaultMaxConsumers) { final int defaultMaxConsumers) {
this.exists = exists; this.exists = exists;
@ -48,7 +48,7 @@ public class BindingQueryResult {
this.autoCreateAddresses = autoCreateAddresses; this.autoCreateAddresses = autoCreateAddresses;
this.defaultDeleteOnNoConsumers = defaultDeleteOnNoConsumers; this.defaultPurgeOnNoConsumers = defaultPurgeOnNoConsumers;
this.defaultMaxConsumers = defaultMaxConsumers; this.defaultMaxConsumers = defaultMaxConsumers;
} }
@ -69,8 +69,8 @@ public class BindingQueryResult {
return queueNames; return queueNames;
} }
public boolean isDefaultDeleteOnNoConsumers() { public boolean isDefaultPurgeOnNoConsumers() {
return defaultDeleteOnNoConsumers; return defaultPurgeOnNoConsumers;
} }
public int getDefaultMaxConsumers() { public int getDefaultMaxConsumers() {

View File

@ -52,9 +52,9 @@ public interface Queue extends Bindable {
boolean isAutoCreated(); boolean isAutoCreated();
boolean isDeleteOnNoConsumers(); boolean isPurgeOnNoConsumers();
void setDeleteOnNoConsumers(boolean value); void setPurgeOnNoConsumers(boolean value);
int getMaxConsumers(); int getMaxConsumers();

View File

@ -36,7 +36,7 @@ public final class QueueConfig {
private final boolean autoCreated; private final boolean autoCreated;
private final RoutingType routingType; private final RoutingType routingType;
private final int maxConsumers; private final int maxConsumers;
private final boolean deleteOnNoConsumers; private final boolean purgeOnNoConsumers;
public static final class Builder { public static final class Builder {
@ -51,7 +51,7 @@ public final class QueueConfig {
private boolean autoCreated; private boolean autoCreated;
private RoutingType routingType; private RoutingType routingType;
private int maxConsumers; private int maxConsumers;
private boolean deleteOnNoConsumers; private boolean purgeOnNoConsumers;
private Builder(final long id, final SimpleString name) { private Builder(final long id, final SimpleString name) {
this(id, name, name); this(id, name, name);
@ -69,7 +69,7 @@ public final class QueueConfig {
this.autoCreated = true; this.autoCreated = true;
this.routingType = ActiveMQDefaultConfiguration.getDefaultRoutingType(); this.routingType = ActiveMQDefaultConfiguration.getDefaultRoutingType();
this.maxConsumers = ActiveMQDefaultConfiguration.getDefaultMaxQueueConsumers(); this.maxConsumers = ActiveMQDefaultConfiguration.getDefaultMaxQueueConsumers();
this.deleteOnNoConsumers = ActiveMQDefaultConfiguration.getDefaultDeleteQueueOnNoConsumers(); this.purgeOnNoConsumers = ActiveMQDefaultConfiguration.getDefaultPurgeOnNoConsumers();
validateState(); validateState();
} }
@ -121,8 +121,8 @@ public final class QueueConfig {
return this; return this;
} }
public Builder deleteOnNoConsumers(final boolean deleteOnNoConsumers) { public Builder purgeOnNoConsumers(final boolean purgeOnNoConsumers) {
this.deleteOnNoConsumers = deleteOnNoConsumers; this.purgeOnNoConsumers = purgeOnNoConsumers;
return this; return this;
} }
@ -152,7 +152,7 @@ public final class QueueConfig {
} else { } else {
pageSubscription = null; pageSubscription = null;
} }
return new QueueConfig(id, address, name, filter, pageSubscription, user, durable, temporary, autoCreated, routingType, maxConsumers, deleteOnNoConsumers); return new QueueConfig(id, address, name, filter, pageSubscription, user, durable, temporary, autoCreated, routingType, maxConsumers, purgeOnNoConsumers);
} }
} }
@ -196,7 +196,7 @@ public final class QueueConfig {
final boolean autoCreated, final boolean autoCreated,
final RoutingType routingType, final RoutingType routingType,
final int maxConsumers, final int maxConsumers,
final boolean deleteOnNoConsumers) { final boolean purgeOnNoConsumers) {
this.id = id; this.id = id;
this.address = address; this.address = address;
this.name = name; this.name = name;
@ -207,7 +207,7 @@ public final class QueueConfig {
this.temporary = temporary; this.temporary = temporary;
this.autoCreated = autoCreated; this.autoCreated = autoCreated;
this.routingType = routingType; this.routingType = routingType;
this.deleteOnNoConsumers = deleteOnNoConsumers; this.purgeOnNoConsumers = purgeOnNoConsumers;
this.maxConsumers = maxConsumers; this.maxConsumers = maxConsumers;
} }
@ -247,8 +247,8 @@ public final class QueueConfig {
return autoCreated; return autoCreated;
} }
public boolean isDeleteOnNoConsumers() { public boolean isPurgeOnNoConsumers() {
return deleteOnNoConsumers; return purgeOnNoConsumers;
} }
public int maxConsumers() { public int maxConsumers() {
@ -288,7 +288,7 @@ public final class QueueConfig {
return false; return false;
if (maxConsumers != that.maxConsumers) if (maxConsumers != that.maxConsumers)
return false; return false;
if (deleteOnNoConsumers != that.deleteOnNoConsumers) if (purgeOnNoConsumers != that.purgeOnNoConsumers)
return false; return false;
return user != null ? user.equals(that.user) : that.user == null; return user != null ? user.equals(that.user) : that.user == null;
@ -307,7 +307,7 @@ public final class QueueConfig {
result = 31 * result + (autoCreated ? 1 : 0); result = 31 * result + (autoCreated ? 1 : 0);
result = 31 * result + routingType.getType(); result = 31 * result + routingType.getType();
result = 31 * result + maxConsumers; result = 31 * result + maxConsumers;
result = 31 * result + (deleteOnNoConsumers ? 1 : 0); result = 31 * result + (purgeOnNoConsumers ? 1 : 0);
return result; return result;
} }
@ -325,6 +325,6 @@ public final class QueueConfig {
+ ", autoCreated=" + autoCreated + ", autoCreated=" + autoCreated
+ ", routingType=" + routingType + ", routingType=" + routingType
+ ", maxConsumers=" + maxConsumers + ", maxConsumers=" + maxConsumers
+ ", deleteOnNoConsumers=" + deleteOnNoConsumers + '}'; + ", purgeOnNoConsumers=" + purgeOnNoConsumers + '}';
} }
} }

View File

@ -134,7 +134,7 @@ public interface ServerSession extends SecurityAuth {
boolean temporary, boolean temporary,
boolean durable, boolean durable,
int maxConsumers, int maxConsumers,
boolean deleteOnNoConsumers, boolean purgeOnNoConsumers,
boolean autoCreated) throws Exception; boolean autoCreated) throws Exception;
Queue createQueue(SimpleString address, Queue createQueue(SimpleString address,

View File

@ -697,7 +697,7 @@ public class ActiveMQServerImpl implements ActiveMQServer {
boolean autoCreateQeueus = addressSettings.isAutoCreateQueues(); boolean autoCreateQeueus = addressSettings.isAutoCreateQueues();
boolean autoCreateAddresses = addressSettings.isAutoCreateAddresses(); boolean autoCreateAddresses = addressSettings.isAutoCreateAddresses();
boolean defaultDeleteOnNoConsumers = addressSettings.isDefaultDeleteOnNoConsumers(); boolean defaultPurgeOnNoConsumers = addressSettings.isDefaultPurgeOnNoConsumers();
int defaultMaxConsumers = addressSettings.getDefaultMaxConsumers(); int defaultMaxConsumers = addressSettings.getDefaultMaxConsumers();
List<SimpleString> names = new ArrayList<>(); List<SimpleString> names = new ArrayList<>();
@ -706,7 +706,7 @@ public class ActiveMQServerImpl implements ActiveMQServer {
ManagementService managementService = getManagementService(); ManagementService managementService = getManagementService();
if (managementService != null) { if (managementService != null) {
if (address.equals(managementService.getManagementAddress())) { if (address.equals(managementService.getManagementAddress())) {
return new BindingQueryResult(true, names, autoCreateQeueus, autoCreateAddresses, defaultDeleteOnNoConsumers, defaultMaxConsumers); return new BindingQueryResult(true, names, autoCreateQeueus, autoCreateAddresses, defaultPurgeOnNoConsumers, defaultMaxConsumers);
} }
} }
@ -718,7 +718,7 @@ public class ActiveMQServerImpl implements ActiveMQServer {
} }
} }
return new BindingQueryResult(getAddressInfo(address) != null, names, autoCreateQeueus, autoCreateAddresses, defaultDeleteOnNoConsumers, defaultMaxConsumers); return new BindingQueryResult(getAddressInfo(address) != null, names, autoCreateQeueus, autoCreateAddresses, defaultPurgeOnNoConsumers, defaultMaxConsumers);
} }
@Override @Override
@ -728,7 +728,7 @@ public class ActiveMQServerImpl implements ActiveMQServer {
} }
boolean autoCreateQueues = getAddressSettingsRepository().getMatch(name.toString()).isAutoCreateQueues(); boolean autoCreateQueues = getAddressSettingsRepository().getMatch(name.toString()).isAutoCreateQueues();
boolean defaultDeleteOnNoConsumers = getAddressSettingsRepository().getMatch(name.toString()).isDefaultDeleteOnNoConsumers(); boolean defaultPurgeOnNoConsumers = getAddressSettingsRepository().getMatch(name.toString()).isDefaultPurgeOnNoConsumers();
int defaultMaxConsumers = getAddressSettingsRepository().getMatch(name.toString()).getDefaultMaxConsumers(); int defaultMaxConsumers = getAddressSettingsRepository().getMatch(name.toString()).getDefaultMaxConsumers();
QueueQueryResult response; QueueQueryResult response;
@ -744,12 +744,12 @@ public class ActiveMQServerImpl implements ActiveMQServer {
SimpleString filterString = filter == null ? null : filter.getFilterString(); SimpleString filterString = filter == null ? null : filter.getFilterString();
response = new QueueQueryResult(name, binding.getAddress(), queue.isDurable(), queue.isTemporary(), filterString, queue.getConsumerCount(), queue.getMessageCount(), autoCreateQueues, true, queue.isAutoCreated(), queue.isDeleteOnNoConsumers(), queue.getRoutingType(), queue.getMaxConsumers()); response = new QueueQueryResult(name, binding.getAddress(), queue.isDurable(), queue.isTemporary(), filterString, queue.getConsumerCount(), queue.getMessageCount(), autoCreateQueues, true, queue.isAutoCreated(), queue.isPurgeOnNoConsumers(), queue.getRoutingType(), queue.getMaxConsumers());
} else if (name.equals(managementAddress)) { } else if (name.equals(managementAddress)) {
// make an exception for the management address (see HORNETQ-29) // make an exception for the management address (see HORNETQ-29)
response = new QueueQueryResult(name, managementAddress, true, false, null, -1, -1, autoCreateQueues, true, false, false, RoutingType.MULTICAST, -1); response = new QueueQueryResult(name, managementAddress, true, false, null, -1, -1, autoCreateQueues, true, false, false, RoutingType.MULTICAST, -1);
} else if (autoCreateQueues) { } else if (autoCreateQueues) {
response = new QueueQueryResult(name, name, true, false, null, 0, 0, true, false, false, defaultDeleteOnNoConsumers, RoutingType.MULTICAST, defaultMaxConsumers); response = new QueueQueryResult(name, name, true, false, null, 0, 0, true, false, false, defaultPurgeOnNoConsumers, RoutingType.MULTICAST, defaultMaxConsumers);
} else { } else {
response = new QueueQueryResult(null, null, false, false, null, 0, 0, false, false, false, false, RoutingType.MULTICAST, 0); response = new QueueQueryResult(null, null, false, false, null, 0, 0, false, false, false, false, RoutingType.MULTICAST, 0);
} }
@ -766,15 +766,15 @@ public class ActiveMQServerImpl implements ActiveMQServer {
AddressSettings addressSettings = getAddressSettingsRepository().getMatch(name.toString()); AddressSettings addressSettings = getAddressSettingsRepository().getMatch(name.toString());
boolean autoCreateAddresses = addressSettings.isAutoCreateAddresses(); boolean autoCreateAddresses = addressSettings.isAutoCreateAddresses();
boolean defaultDeleteOnNoConsumers = addressSettings.isDefaultDeleteOnNoConsumers(); boolean defaultPurgeOnNoConsumers = addressSettings.isDefaultPurgeOnNoConsumers();
int defaultMaxConsumers = addressSettings.getDefaultMaxConsumers(); int defaultMaxConsumers = addressSettings.getDefaultMaxConsumers();
AddressInfo addressInfo = postOffice.getAddressInfo(name); AddressInfo addressInfo = postOffice.getAddressInfo(name);
AddressQueryResult response; AddressQueryResult response;
if (addressInfo != null) { if (addressInfo != null) {
response = new AddressQueryResult(addressInfo.getName(), addressInfo.getRoutingTypes(), addressInfo.getId(), addressInfo.isAutoCreated(), true, autoCreateAddresses, defaultDeleteOnNoConsumers, defaultMaxConsumers); response = new AddressQueryResult(addressInfo.getName(), addressInfo.getRoutingTypes(), addressInfo.getId(), addressInfo.isAutoCreated(), true, autoCreateAddresses, defaultPurgeOnNoConsumers, defaultMaxConsumers);
} else { } else {
response = new AddressQueryResult(name, null, -1, false, false, autoCreateAddresses, defaultDeleteOnNoConsumers, defaultMaxConsumers); response = new AddressQueryResult(name, null, -1, false, false, autoCreateAddresses, defaultPurgeOnNoConsumers, defaultMaxConsumers);
} }
return response; return response;
} }
@ -1503,7 +1503,7 @@ public class ActiveMQServerImpl implements ActiveMQServer {
final boolean durable, final boolean durable,
final boolean temporary) throws Exception { final boolean temporary) throws Exception {
AddressSettings as = getAddressSettingsRepository().getMatch(address.toString()); AddressSettings as = getAddressSettingsRepository().getMatch(address.toString());
return createQueue(address, routingType, queueName, filterString, durable, temporary, as.getDefaultMaxConsumers(), as.isDefaultDeleteOnNoConsumers(), as.isAutoCreateAddresses()); return createQueue(address, routingType, queueName, filterString, durable, temporary, as.getDefaultMaxConsumers(), as.isDefaultPurgeOnNoConsumers(), as.isAutoCreateAddresses());
} }
@Override @Override
@ -1514,9 +1514,9 @@ public class ActiveMQServerImpl implements ActiveMQServer {
final boolean durable, final boolean durable,
final boolean temporary, final boolean temporary,
final int maxConsumers, final int maxConsumers,
final boolean deleteOnNoConsumers, final boolean purgeOnNoConsumers,
final boolean autoCreateAddress) throws Exception { final boolean autoCreateAddress) throws Exception {
return createQueue(address, routingType, queueName, filter, null, durable, temporary, false, maxConsumers, deleteOnNoConsumers, autoCreateAddress); return createQueue(address, routingType, queueName, filter, null, durable, temporary, false, maxConsumers, purgeOnNoConsumers, autoCreateAddress);
} }
@Override @Override
@ -2230,7 +2230,7 @@ public class ActiveMQServerImpl implements ActiveMQServer {
for (CoreQueueConfiguration config : queues) { for (CoreQueueConfiguration config : queues) {
ActiveMQServerLogger.LOGGER.deployQueue(SimpleString.toSimpleString(config.getName())); ActiveMQServerLogger.LOGGER.deployQueue(SimpleString.toSimpleString(config.getName()));
createQueue(SimpleString.toSimpleString(config.getAddress()), config.getRoutingType(), SimpleString.toSimpleString(config.getName()), SimpleString.toSimpleString(config.getFilterString()), null, config.isDurable(), false, true, false, false, config.getMaxConsumers(), config.getDeleteOnNoConsumers(), true); createQueue(SimpleString.toSimpleString(config.getAddress()), config.getRoutingType(), SimpleString.toSimpleString(config.getName()), SimpleString.toSimpleString(config.getFilterString()), null, config.isDurable(), false, true, false, false, config.getMaxConsumers(), config.getPurgeOnNoConsumers(), true);
} }
} }
@ -2415,7 +2415,7 @@ public class ActiveMQServerImpl implements ActiveMQServer {
final boolean transientQueue, final boolean transientQueue,
final boolean autoCreated, final boolean autoCreated,
final int maxConsumers, final int maxConsumers,
final boolean deleteOnNoConsumers, final boolean purgeOnNoConsumers,
final boolean autoCreateAddress) throws Exception { final boolean autoCreateAddress) throws Exception {
final QueueBinding binding = (QueueBinding) postOffice.getBinding(queueName); final QueueBinding binding = (QueueBinding) postOffice.getBinding(queueName);
@ -2459,7 +2459,7 @@ public class ActiveMQServerImpl implements ActiveMQServer {
throw ActiveMQMessageBundle.BUNDLE.invalidRoutingTypeForAddress(routingType, info.getName().toString(), info.getRoutingTypes()); throw ActiveMQMessageBundle.BUNDLE.invalidRoutingTypeForAddress(routingType, info.getName().toString(), info.getRoutingTypes());
} }
final QueueConfig queueConfig = queueConfigBuilder.filter(filter).pagingManager(pagingManager).user(user).durable(durable).temporary(temporary).autoCreated(autoCreated).routingType(routingType).maxConsumers(maxConsumers).deleteOnNoConsumers(deleteOnNoConsumers).build(); final QueueConfig queueConfig = queueConfigBuilder.filter(filter).pagingManager(pagingManager).user(user).durable(durable).temporary(temporary).autoCreated(autoCreated).routingType(routingType).maxConsumers(maxConsumers).purgeOnNoConsumers(purgeOnNoConsumers).build();
final Queue queue = queueFactory.createQueueWith(queueConfig); final Queue queue = queueFactory.createQueueWith(queueConfig);
@ -2510,8 +2510,8 @@ public class ActiveMQServerImpl implements ActiveMQServer {
public Queue updateQueue(String name, public Queue updateQueue(String name,
RoutingType routingType, RoutingType routingType,
Integer maxConsumers, Integer maxConsumers,
Boolean deleteOnNoConsumers) throws Exception { Boolean purgeOnNoConsumers) throws Exception {
final QueueBinding queueBinding = this.postOffice.updateQueue(new SimpleString(name), routingType, maxConsumers, deleteOnNoConsumers); final QueueBinding queueBinding = this.postOffice.updateQueue(new SimpleString(name), routingType, maxConsumers, purgeOnNoConsumers);
if (queueBinding != null) { if (queueBinding != null) {
final Queue queue = queueBinding.getQueue(); final Queue queue = queueBinding.getQueue();
if (queue.isDurable()) { if (queue.isDurable()) {

View File

@ -39,7 +39,7 @@ public class AutoCreatedQueueManagerImpl implements AutoCreatedQueueManager {
long consumerCount = queue.getConsumerCount(); long consumerCount = queue.getConsumerCount();
long messageCount = queue.getMessageCount(); long messageCount = queue.getMessageCount();
if (((queue.isAutoCreated() && settings.isAutoDeleteQueues()) || queue.isDeleteOnNoConsumers()) && queue.getMessageCount() == 0) { if (((queue.isAutoCreated() && settings.isAutoDeleteQueues()) || queue.isPurgeOnNoConsumers()) && queue.getMessageCount() == 0) {
if (ActiveMQServerLogger.LOGGER.isDebugEnabled()) { if (ActiveMQServerLogger.LOGGER.isDebugEnabled()) {
ActiveMQServerLogger.LOGGER.debug("deleting " + (queue.isAutoCreated() ? "auto-created " : "") + "queue \"" + queueName + ".\" consumerCount = " + consumerCount + "; messageCount = " + messageCount + "; isAutoDeleteQueues = " + settings.isAutoDeleteQueues()); ActiveMQServerLogger.LOGGER.debug("deleting " + (queue.isAutoCreated() ? "auto-created " : "") + "queue \"" + queueName + ".\" consumerCount = " + consumerCount + "; messageCount = " + messageCount + "; isAutoDeleteQueues = " + settings.isAutoDeleteQueues());
} }

View File

@ -59,13 +59,13 @@ public class LastValueQueue extends QueueImpl {
final boolean autoCreated, final boolean autoCreated,
final RoutingType routingType, final RoutingType routingType,
final Integer maxConsumers, final Integer maxConsumers,
final Boolean deleteOnNoConsumers, final Boolean purgeOnNoConsumers,
final ScheduledExecutorService scheduledExecutor, final ScheduledExecutorService scheduledExecutor,
final PostOffice postOffice, final PostOffice postOffice,
final StorageManager storageManager, final StorageManager storageManager,
final HierarchicalRepository<AddressSettings> addressSettingsRepository, final HierarchicalRepository<AddressSettings> addressSettingsRepository,
final Executor executor) { final Executor executor) {
super(persistenceID, address, name, filter, pageSubscription, user, durable, temporary, autoCreated, routingType, maxConsumers, deleteOnNoConsumers, scheduledExecutor, postOffice, storageManager, addressSettingsRepository, executor); super(persistenceID, address, name, filter, pageSubscription, user, durable, temporary, autoCreated, routingType, maxConsumers, purgeOnNoConsumers, scheduledExecutor, postOffice, storageManager, addressSettingsRepository, executor);
new Exception("LastValueQeue " + this).toString(); new Exception("LastValueQeue " + this).toString();
} }

View File

@ -149,7 +149,7 @@ public class PostOfficeJournalLoader implements JournalLoader {
.durable(true) .durable(true)
.temporary(false) .temporary(false)
.autoCreated(queueBindingInfo.isAutoCreated()) .autoCreated(queueBindingInfo.isAutoCreated())
.deleteOnNoConsumers(queueBindingInfo.isDeleteOnNoConsumers()) .purgeOnNoConsumers(queueBindingInfo.isPurgeOnNoConsumers())
.maxConsumers(queueBindingInfo.getMaxConsumers()) .maxConsumers(queueBindingInfo.getMaxConsumers())
.routingType(RoutingType.getType(queueBindingInfo.getRoutingType())); .routingType(RoutingType.getType(queueBindingInfo.getRoutingType()));
final Queue queue = queueFactory.createQueueWith(queueConfigBuilder.build()); final Queue queue = queueFactory.createQueueWith(queueConfigBuilder.build());

View File

@ -72,9 +72,9 @@ public class QueueFactoryImpl implements QueueFactory {
final AddressSettings addressSettings = addressSettingsRepository.getMatch(config.address().toString()); final AddressSettings addressSettings = addressSettingsRepository.getMatch(config.address().toString());
final Queue queue; final Queue queue;
if (addressSettings.isLastValueQueue()) { if (addressSettings.isLastValueQueue()) {
queue = new LastValueQueue(config.id(), config.address(), config.name(), config.filter(), config.pageSubscription(), config.user(), config.isDurable(), config.isTemporary(), config.isAutoCreated(), config.deliveryMode(), config.maxConsumers(), config.isDeleteOnNoConsumers(), scheduledExecutor, postOffice, storageManager, addressSettingsRepository, executorFactory.getExecutor()); queue = new LastValueQueue(config.id(), config.address(), config.name(), config.filter(), config.pageSubscription(), config.user(), config.isDurable(), config.isTemporary(), config.isAutoCreated(), config.deliveryMode(), config.maxConsumers(), config.isPurgeOnNoConsumers(), scheduledExecutor, postOffice, storageManager, addressSettingsRepository, executorFactory.getExecutor());
} else { } else {
queue = new QueueImpl(config.id(), config.address(), config.name(), config.filter(), config.pageSubscription(), config.user(), config.isDurable(), config.isTemporary(), config.isAutoCreated(), config.deliveryMode(), config.maxConsumers(), config.isDeleteOnNoConsumers(), scheduledExecutor, postOffice, storageManager, addressSettingsRepository, executorFactory.getExecutor()); queue = new QueueImpl(config.id(), config.address(), config.name(), config.filter(), config.pageSubscription(), config.user(), config.isDurable(), config.isTemporary(), config.isAutoCreated(), config.deliveryMode(), config.maxConsumers(), config.isPurgeOnNoConsumers(), scheduledExecutor, postOffice, storageManager, addressSettingsRepository, executorFactory.getExecutor());
} }
return queue; return queue;
} }
@ -98,7 +98,7 @@ public class QueueFactoryImpl implements QueueFactory {
Queue queue; Queue queue;
if (addressSettings.isLastValueQueue()) { if (addressSettings.isLastValueQueue()) {
queue = new LastValueQueue(persistenceID, address, name, filter, pageSubscription, user, durable, temporary, autoCreated, ActiveMQDefaultConfiguration.getDefaultRoutingType(), ActiveMQDefaultConfiguration.getDefaultMaxQueueConsumers(), ActiveMQDefaultConfiguration.getDefaultDeleteQueueOnNoConsumers(), scheduledExecutor, postOffice, storageManager, addressSettingsRepository, executorFactory.getExecutor()); queue = new LastValueQueue(persistenceID, address, name, filter, pageSubscription, user, durable, temporary, autoCreated, ActiveMQDefaultConfiguration.getDefaultRoutingType(), ActiveMQDefaultConfiguration.getDefaultMaxQueueConsumers(), ActiveMQDefaultConfiguration.getDefaultPurgeOnNoConsumers(), scheduledExecutor, postOffice, storageManager, addressSettingsRepository, executorFactory.getExecutor());
} else { } else {
queue = new QueueImpl(persistenceID, address, name, filter, pageSubscription, user, durable, temporary, autoCreated, scheduledExecutor, postOffice, storageManager, addressSettingsRepository, executorFactory.getExecutor()); queue = new QueueImpl(persistenceID, address, name, filter, pageSubscription, user, durable, temporary, autoCreated, scheduledExecutor, postOffice, storageManager, addressSettingsRepository, executorFactory.getExecutor());
} }

View File

@ -242,7 +242,7 @@ public class QueueImpl implements Queue {
private volatile int maxConsumers; private volatile int maxConsumers;
private volatile boolean deleteOnNoConsumers; private volatile boolean purgeOnNoConsumers;
private final AddressInfo addressInfo; private final AddressInfo addressInfo;
@ -360,7 +360,7 @@ public class QueueImpl implements Queue {
final boolean autoCreated, final boolean autoCreated,
final RoutingType routingType, final RoutingType routingType,
final Integer maxConsumers, final Integer maxConsumers,
final Boolean deleteOnNoConsumers, final Boolean purgeOnNoConsumers,
final ScheduledExecutorService scheduledExecutor, final ScheduledExecutorService scheduledExecutor,
final PostOffice postOffice, final PostOffice postOffice,
final StorageManager storageManager, final StorageManager storageManager,
@ -389,7 +389,7 @@ public class QueueImpl implements Queue {
this.maxConsumers = maxConsumers == null ? ActiveMQDefaultConfiguration.getDefaultMaxQueueConsumers() : maxConsumers; this.maxConsumers = maxConsumers == null ? ActiveMQDefaultConfiguration.getDefaultMaxQueueConsumers() : maxConsumers;
this.deleteOnNoConsumers = deleteOnNoConsumers == null ? ActiveMQDefaultConfiguration.getDefaultDeleteQueueOnNoConsumers() : deleteOnNoConsumers; this.purgeOnNoConsumers = purgeOnNoConsumers == null ? ActiveMQDefaultConfiguration.getDefaultPurgeOnNoConsumers() : purgeOnNoConsumers;
this.postOffice = postOffice; this.postOffice = postOffice;
@ -478,13 +478,13 @@ public class QueueImpl implements Queue {
} }
@Override @Override
public boolean isDeleteOnNoConsumers() { public boolean isPurgeOnNoConsumers() {
return deleteOnNoConsumers; return purgeOnNoConsumers;
} }
@Override @Override
public synchronized void setDeleteOnNoConsumers(boolean value) { public synchronized void setPurgeOnNoConsumers(boolean value) {
this.deleteOnNoConsumers = value; this.purgeOnNoConsumers = value;
} }
@Override @Override
@ -851,7 +851,7 @@ public class QueueImpl implements Queue {
refCountForConsumers.decrement(); refCountForConsumers.decrement();
} }
if (noConsumers.decrementAndGet() == 0 && deleteOnNoConsumers) { if (noConsumers.decrementAndGet() == 0 && purgeOnNoConsumers) {
try { try {
deleteQueue(); deleteQueue();
} catch (Exception e) { } catch (Exception e) {

View File

@ -506,7 +506,7 @@ public class ServerSessionImpl implements ServerSession, FailureListener {
final boolean temporary, final boolean temporary,
final boolean durable) throws Exception { final boolean durable) throws Exception {
AddressSettings as = server.getAddressSettingsRepository().getMatch(address.toString()); AddressSettings as = server.getAddressSettingsRepository().getMatch(address.toString());
return createQueue(address, name, as.getDefaultQueueRoutingType(), filterString, temporary, durable, as.getDefaultMaxConsumers(), as.isDefaultDeleteOnNoConsumers(), false); return createQueue(address, name, as.getDefaultQueueRoutingType(), filterString, temporary, durable, as.getDefaultMaxConsumers(), as.isDefaultPurgeOnNoConsumers(), false);
} }
@Override @Override
@ -517,7 +517,7 @@ public class ServerSessionImpl implements ServerSession, FailureListener {
final boolean temporary, final boolean temporary,
final boolean durable) throws Exception { final boolean durable) throws Exception {
AddressSettings as = server.getAddressSettingsRepository().getMatch(address.toString()); AddressSettings as = server.getAddressSettingsRepository().getMatch(address.toString());
return createQueue(address, name, routingType, filterString, temporary, durable, as.getDefaultMaxConsumers(), as.isDefaultDeleteOnNoConsumers(), false); return createQueue(address, name, routingType, filterString, temporary, durable, as.getDefaultMaxConsumers(), as.isDefaultPurgeOnNoConsumers(), false);
} }
@Override @Override
@ -528,7 +528,7 @@ public class ServerSessionImpl implements ServerSession, FailureListener {
final boolean temporary, final boolean temporary,
final boolean durable, final boolean durable,
final int maxConsumers, final int maxConsumers,
final boolean deleteOnNoConsumers, final boolean purgeOnNoConsumers,
final boolean autoCreated) throws Exception { final boolean autoCreated) throws Exception {
final SimpleString unPrefixedName = removePrefix(name); final SimpleString unPrefixedName = removePrefix(name);
@ -543,7 +543,7 @@ public class ServerSessionImpl implements ServerSession, FailureListener {
server.checkQueueCreationLimit(getUsername()); server.checkQueueCreationLimit(getUsername());
Queue queue = server.createQueue(art.getA(), art.getB(), unPrefixedName, filterString, SimpleString.toSimpleString(getUsername()), durable, temporary, autoCreated, maxConsumers, deleteOnNoConsumers, server.getAddressSettingsRepository().getMatch(address.toString()).isAutoCreateAddresses()); Queue queue = server.createQueue(art.getA(), art.getB(), unPrefixedName, filterString, SimpleString.toSimpleString(getUsername()), durable, temporary, autoCreated, maxConsumers, purgeOnNoConsumers, server.getAddressSettingsRepository().getMatch(address.toString()).isAutoCreateAddresses());
if (temporary) { if (temporary) {
// Temporary queue in core simply means the queue will be deleted if // Temporary queue in core simply means the queue will be deleted if
@ -582,7 +582,7 @@ public class ServerSessionImpl implements ServerSession, FailureListener {
boolean durable, boolean durable,
boolean autoCreated) throws Exception { boolean autoCreated) throws Exception {
AddressSettings as = server.getAddressSettingsRepository().getMatch(address.toString()); AddressSettings as = server.getAddressSettingsRepository().getMatch(address.toString());
return createQueue(address, name, routingType, filterString, temporary, durable, as.getDefaultMaxConsumers(), as.isDefaultDeleteOnNoConsumers(), autoCreated); return createQueue(address, name, routingType, filterString, temporary, durable, as.getDefaultMaxConsumers(), as.isDefaultPurgeOnNoConsumers(), autoCreated);
} }
@Override @Override

View File

@ -158,7 +158,7 @@ public class AddressSettings implements Mergeable<AddressSettings>, Serializable
private Integer defaultMaxConsumers = null; private Integer defaultMaxConsumers = null;
private Boolean defaultDeleteOnNoConsumers = null; private Boolean defaultPurgeOnNoConsumers = null;
private RoutingType defaultQueueRoutingType = null; private RoutingType defaultQueueRoutingType = null;
@ -200,7 +200,7 @@ public class AddressSettings implements Mergeable<AddressSettings>, Serializable
this.queuePrefetch = other.queuePrefetch; this.queuePrefetch = other.queuePrefetch;
this.maxSizeBytesRejectThreshold = other.maxSizeBytesRejectThreshold; this.maxSizeBytesRejectThreshold = other.maxSizeBytesRejectThreshold;
this.defaultMaxConsumers = other.defaultMaxConsumers; this.defaultMaxConsumers = other.defaultMaxConsumers;
this.defaultDeleteOnNoConsumers = other.defaultDeleteOnNoConsumers; this.defaultPurgeOnNoConsumers = other.defaultPurgeOnNoConsumers;
this.defaultQueueRoutingType = other.defaultQueueRoutingType; this.defaultQueueRoutingType = other.defaultQueueRoutingType;
this.defaultAddressRoutingType = other.defaultAddressRoutingType; this.defaultAddressRoutingType = other.defaultAddressRoutingType;
} }
@ -297,12 +297,12 @@ public class AddressSettings implements Mergeable<AddressSettings>, Serializable
return this; return this;
} }
public boolean isDefaultDeleteOnNoConsumers() { public boolean isDefaultPurgeOnNoConsumers() {
return defaultDeleteOnNoConsumers != null ? defaultDeleteOnNoConsumers : ActiveMQDefaultConfiguration.getDefaultDeleteQueueOnNoConsumers(); return defaultPurgeOnNoConsumers != null ? defaultPurgeOnNoConsumers : ActiveMQDefaultConfiguration.getDefaultPurgeOnNoConsumers();
} }
public AddressSettings setDefaultDeleteOnNoConsumers(Boolean defaultDeleteOnNoConsumers) { public AddressSettings setDefaultPurgeOnNoConsumers(Boolean defaultPurgeOnNoConsumers) {
this.defaultDeleteOnNoConsumers = defaultDeleteOnNoConsumers; this.defaultPurgeOnNoConsumers = defaultPurgeOnNoConsumers;
return this; return this;
} }
@ -612,8 +612,8 @@ public class AddressSettings implements Mergeable<AddressSettings>, Serializable
if (defaultMaxConsumers == null) { if (defaultMaxConsumers == null) {
defaultMaxConsumers = merged.defaultMaxConsumers; defaultMaxConsumers = merged.defaultMaxConsumers;
} }
if (defaultDeleteOnNoConsumers == null) { if (defaultPurgeOnNoConsumers == null) {
defaultDeleteOnNoConsumers = merged.defaultDeleteOnNoConsumers; defaultPurgeOnNoConsumers = merged.defaultPurgeOnNoConsumers;
} }
if (defaultQueueRoutingType == null) { if (defaultQueueRoutingType == null) {
defaultQueueRoutingType = merged.defaultQueueRoutingType; defaultQueueRoutingType = merged.defaultQueueRoutingType;
@ -697,7 +697,7 @@ public class AddressSettings implements Mergeable<AddressSettings>, Serializable
defaultMaxConsumers = BufferHelper.readNullableInteger(buffer); defaultMaxConsumers = BufferHelper.readNullableInteger(buffer);
defaultDeleteOnNoConsumers = BufferHelper.readNullableBoolean(buffer); defaultPurgeOnNoConsumers = BufferHelper.readNullableBoolean(buffer);
defaultQueueRoutingType = RoutingType.getType(buffer.readByte()); defaultQueueRoutingType = RoutingType.getType(buffer.readByte());
@ -737,7 +737,7 @@ public class AddressSettings implements Mergeable<AddressSettings>, Serializable
BufferHelper.sizeOfNullableInteger(managementBrowsePageSize) + BufferHelper.sizeOfNullableInteger(managementBrowsePageSize) +
BufferHelper.sizeOfNullableLong(maxSizeBytesRejectThreshold) + BufferHelper.sizeOfNullableLong(maxSizeBytesRejectThreshold) +
BufferHelper.sizeOfNullableInteger(defaultMaxConsumers) + BufferHelper.sizeOfNullableInteger(defaultMaxConsumers) +
BufferHelper.sizeOfNullableBoolean(defaultDeleteOnNoConsumers) + BufferHelper.sizeOfNullableBoolean(defaultPurgeOnNoConsumers) +
DataConstants.SIZE_BYTE + DataConstants.SIZE_BYTE +
DataConstants.SIZE_BYTE; DataConstants.SIZE_BYTE;
} }
@ -804,7 +804,7 @@ public class AddressSettings implements Mergeable<AddressSettings>, Serializable
BufferHelper.writeNullableInteger(buffer, defaultMaxConsumers); BufferHelper.writeNullableInteger(buffer, defaultMaxConsumers);
BufferHelper.writeNullableBoolean(buffer, defaultDeleteOnNoConsumers); BufferHelper.writeNullableBoolean(buffer, defaultPurgeOnNoConsumers);
buffer.writeByte(defaultQueueRoutingType == null ? -1 : defaultQueueRoutingType.getType()); buffer.writeByte(defaultQueueRoutingType == null ? -1 : defaultQueueRoutingType.getType());
@ -849,7 +849,7 @@ public class AddressSettings implements Mergeable<AddressSettings>, Serializable
result = prime * result + ((queuePrefetch == null) ? 0 : queuePrefetch.hashCode()); result = prime * result + ((queuePrefetch == null) ? 0 : queuePrefetch.hashCode());
result = prime * result + ((maxSizeBytesRejectThreshold == null) ? 0 : maxSizeBytesRejectThreshold.hashCode()); result = prime * result + ((maxSizeBytesRejectThreshold == null) ? 0 : maxSizeBytesRejectThreshold.hashCode());
result = prime * result + ((defaultMaxConsumers == null) ? 0 : defaultMaxConsumers.hashCode()); result = prime * result + ((defaultMaxConsumers == null) ? 0 : defaultMaxConsumers.hashCode());
result = prime * result + ((defaultDeleteOnNoConsumers == null) ? 0 : defaultDeleteOnNoConsumers.hashCode()); result = prime * result + ((defaultPurgeOnNoConsumers == null) ? 0 : defaultPurgeOnNoConsumers.hashCode());
result = prime * result + ((defaultQueueRoutingType == null) ? 0 : defaultQueueRoutingType.hashCode()); result = prime * result + ((defaultQueueRoutingType == null) ? 0 : defaultQueueRoutingType.hashCode());
result = prime * result + ((defaultAddressRoutingType == null) ? 0 : defaultAddressRoutingType.hashCode()); result = prime * result + ((defaultAddressRoutingType == null) ? 0 : defaultAddressRoutingType.hashCode());
return result; return result;
@ -1025,10 +1025,10 @@ public class AddressSettings implements Mergeable<AddressSettings>, Serializable
} else if (!defaultMaxConsumers.equals(other.defaultMaxConsumers)) } else if (!defaultMaxConsumers.equals(other.defaultMaxConsumers))
return false; return false;
if (defaultDeleteOnNoConsumers == null) { if (defaultPurgeOnNoConsumers == null) {
if (other.defaultDeleteOnNoConsumers != null) if (other.defaultPurgeOnNoConsumers != null)
return false; return false;
} else if (!defaultDeleteOnNoConsumers.equals(other.defaultDeleteOnNoConsumers)) } else if (!defaultPurgeOnNoConsumers.equals(other.defaultPurgeOnNoConsumers))
return false; return false;
if (defaultQueueRoutingType == null) { if (defaultQueueRoutingType == null) {
@ -1109,8 +1109,8 @@ public class AddressSettings implements Mergeable<AddressSettings>, Serializable
managementBrowsePageSize + managementBrowsePageSize +
", defaultMaxConsumers=" + ", defaultMaxConsumers=" +
defaultMaxConsumers + defaultMaxConsumers +
", defaultDeleteOnNoConsumers=" + ", defaultPurgeOnNoConsumers=" +
defaultDeleteOnNoConsumers + defaultPurgeOnNoConsumers +
", defaultQueueRoutingType=" + ", defaultQueueRoutingType=" +
defaultQueueRoutingType + defaultQueueRoutingType +
", defaultAddressRoutingType=" + ", defaultAddressRoutingType=" +

View File

@ -2553,10 +2553,11 @@
</xsd:annotation> </xsd:annotation>
</xsd:element> </xsd:element>
<xsd:element name="default-delete-on-no-consumers" type="xsd:boolean" default="false" maxOccurs="1" minOccurs="0"> <xsd:element name="default-purge-on-no-consumers" type="xsd:boolean" default="false" maxOccurs="1"
minOccurs="0">
<xsd:annotation> <xsd:annotation>
<xsd:documentation> <xsd:documentation>
Purge and pause this queue when the last consumer disconnects purge the contents of the queue once there are no consumers
</xsd:documentation> </xsd:documentation>
</xsd:annotation> </xsd:annotation>
</xsd:element> </xsd:element>
@ -2704,7 +2705,7 @@
</xsd:all> </xsd:all>
<xsd:attribute name="name" type="xsd:ID" use="required"/> <xsd:attribute name="name" type="xsd:ID" use="required"/>
<xsd:attribute name="max-consumers" type="xsd:integer" use="optional"/> <xsd:attribute name="max-consumers" type="xsd:integer" use="optional"/>
<xsd:attribute name="delete-on-no-consumers" type="xsd:boolean" use="optional"/> <xsd:attribute name="purge-on-no-consumers" type="xsd:boolean" use="optional"/>
</xsd:complexType> </xsd:complexType>
<xsd:complexType name="addressType"> <xsd:complexType name="addressType">

View File

@ -305,7 +305,7 @@ public class FileConfigurationTest extends ConfigurationImplTest {
assertEquals(true, conf.getAddressesSettings().get("a1").isAutoDeleteJmsQueues()); assertEquals(true, conf.getAddressesSettings().get("a1").isAutoDeleteJmsQueues());
assertEquals(true, conf.getAddressesSettings().get("a1").isAutoCreateJmsTopics()); assertEquals(true, conf.getAddressesSettings().get("a1").isAutoCreateJmsTopics());
assertEquals(true, conf.getAddressesSettings().get("a1").isAutoDeleteJmsTopics()); assertEquals(true, conf.getAddressesSettings().get("a1").isAutoDeleteJmsTopics());
assertEquals(false, conf.getAddressesSettings().get("a1").isDefaultDeleteOnNoConsumers()); assertEquals(false, conf.getAddressesSettings().get("a1").isDefaultPurgeOnNoConsumers());
assertEquals(5, conf.getAddressesSettings().get("a1").getDefaultMaxConsumers()); assertEquals(5, conf.getAddressesSettings().get("a1").getDefaultMaxConsumers());
assertEquals(RoutingType.ANYCAST, conf.getAddressesSettings().get("a1").getDefaultQueueRoutingType()); assertEquals(RoutingType.ANYCAST, conf.getAddressesSettings().get("a1").getDefaultQueueRoutingType());
assertEquals(RoutingType.MULTICAST, conf.getAddressesSettings().get("a1").getDefaultAddressRoutingType()); assertEquals(RoutingType.MULTICAST, conf.getAddressesSettings().get("a1").getDefaultAddressRoutingType());
@ -324,7 +324,7 @@ public class FileConfigurationTest extends ConfigurationImplTest {
assertEquals(false, conf.getAddressesSettings().get("a2").isAutoDeleteJmsQueues()); assertEquals(false, conf.getAddressesSettings().get("a2").isAutoDeleteJmsQueues());
assertEquals(false, conf.getAddressesSettings().get("a2").isAutoCreateJmsTopics()); assertEquals(false, conf.getAddressesSettings().get("a2").isAutoCreateJmsTopics());
assertEquals(false, conf.getAddressesSettings().get("a2").isAutoDeleteJmsTopics()); assertEquals(false, conf.getAddressesSettings().get("a2").isAutoDeleteJmsTopics());
assertEquals(true, conf.getAddressesSettings().get("a2").isDefaultDeleteOnNoConsumers()); assertEquals(true, conf.getAddressesSettings().get("a2").isDefaultPurgeOnNoConsumers());
assertEquals(15, conf.getAddressesSettings().get("a2").getDefaultMaxConsumers()); assertEquals(15, conf.getAddressesSettings().get("a2").getDefaultMaxConsumers());
assertEquals(RoutingType.MULTICAST, conf.getAddressesSettings().get("a2").getDefaultQueueRoutingType()); assertEquals(RoutingType.MULTICAST, conf.getAddressesSettings().get("a2").getDefaultQueueRoutingType());
assertEquals(RoutingType.ANYCAST, conf.getAddressesSettings().get("a2").getDefaultAddressRoutingType()); assertEquals(RoutingType.ANYCAST, conf.getAddressesSettings().get("a2").getDefaultAddressRoutingType());
@ -398,7 +398,7 @@ public class FileConfigurationTest extends ConfigurationImplTest {
assertEquals("q1", queueConfiguration.getName()); assertEquals("q1", queueConfiguration.getName());
assertFalse(queueConfiguration.isDurable()); assertFalse(queueConfiguration.isDurable());
assertEquals("color='blue'", queueConfiguration.getFilterString()); assertEquals("color='blue'", queueConfiguration.getFilterString());
assertEquals(ActiveMQDefaultConfiguration.getDefaultDeleteQueueOnNoConsumers(), queueConfiguration.getDeleteOnNoConsumers()); assertEquals(ActiveMQDefaultConfiguration.getDefaultPurgeOnNoConsumers(), queueConfiguration.getPurgeOnNoConsumers());
assertEquals("addr1", queueConfiguration.getAddress()); assertEquals("addr1", queueConfiguration.getAddress());
assertEquals(ActiveMQDefaultConfiguration.getDefaultMaxQueueConsumers(), queueConfiguration.getMaxConsumers()); assertEquals(ActiveMQDefaultConfiguration.getDefaultMaxQueueConsumers(), queueConfiguration.getMaxConsumers());
@ -409,7 +409,7 @@ public class FileConfigurationTest extends ConfigurationImplTest {
assertTrue(queueConfiguration.isDurable()); assertTrue(queueConfiguration.isDurable());
assertEquals("color='green'", queueConfiguration.getFilterString()); assertEquals("color='green'", queueConfiguration.getFilterString());
assertEquals(Queue.MAX_CONSUMERS_UNLIMITED, queueConfiguration.getMaxConsumers()); assertEquals(Queue.MAX_CONSUMERS_UNLIMITED, queueConfiguration.getMaxConsumers());
assertFalse(queueConfiguration.getDeleteOnNoConsumers()); assertFalse(queueConfiguration.getPurgeOnNoConsumers());
assertEquals("addr1", queueConfiguration.getAddress()); assertEquals("addr1", queueConfiguration.getAddress());
// Addr 2 // Addr 2
@ -427,7 +427,7 @@ public class FileConfigurationTest extends ConfigurationImplTest {
assertTrue(queueConfiguration.isDurable()); assertTrue(queueConfiguration.isDurable());
assertEquals("color='red'", queueConfiguration.getFilterString()); assertEquals("color='red'", queueConfiguration.getFilterString());
assertEquals(10, queueConfiguration.getMaxConsumers()); assertEquals(10, queueConfiguration.getMaxConsumers());
assertEquals(ActiveMQDefaultConfiguration.getDefaultDeleteQueueOnNoConsumers(), queueConfiguration.getDeleteOnNoConsumers()); assertEquals(ActiveMQDefaultConfiguration.getDefaultPurgeOnNoConsumers(), queueConfiguration.getPurgeOnNoConsumers());
assertEquals("addr2", queueConfiguration.getAddress()); assertEquals("addr2", queueConfiguration.getAddress());
// Addr 2 Queue 2 // Addr 2 Queue 2
@ -437,7 +437,7 @@ public class FileConfigurationTest extends ConfigurationImplTest {
assertTrue(queueConfiguration.isDurable()); assertTrue(queueConfiguration.isDurable());
assertNull(queueConfiguration.getFilterString()); assertNull(queueConfiguration.getFilterString());
assertEquals(ActiveMQDefaultConfiguration.getDefaultMaxQueueConsumers(), queueConfiguration.getMaxConsumers()); assertEquals(ActiveMQDefaultConfiguration.getDefaultMaxQueueConsumers(), queueConfiguration.getMaxConsumers());
assertTrue(queueConfiguration.getDeleteOnNoConsumers()); assertTrue(queueConfiguration.getPurgeOnNoConsumers());
assertEquals("addr2", queueConfiguration.getAddress()); assertEquals("addr2", queueConfiguration.getAddress());
// Addr 3 // Addr 3

View File

@ -838,7 +838,7 @@ public class ScheduledDeliveryHandlerTest extends Assert {
public class FakeQueueForScheduleUnitTest implements Queue { public class FakeQueueForScheduleUnitTest implements Queue {
@Override @Override
public void setDeleteOnNoConsumers(boolean value) { public void setPurgeOnNoConsumers(boolean value) {
} }
@ -922,7 +922,7 @@ public class ScheduledDeliveryHandlerTest extends Assert {
} }
@Override @Override
public boolean isDeleteOnNoConsumers() { public boolean isPurgeOnNoConsumers() {
return false; return false;
} }

View File

@ -48,7 +48,7 @@ public class AddressSettingsTest extends ActiveMQTestBase {
Assert.assertEquals(AddressSettings.DEFAULT_AUTO_DELETE_QUEUES, addressSettings.isAutoDeleteQueues()); Assert.assertEquals(AddressSettings.DEFAULT_AUTO_DELETE_QUEUES, addressSettings.isAutoDeleteQueues());
Assert.assertEquals(AddressSettings.DEFAULT_AUTO_CREATE_ADDRESSES, addressSettings.isAutoCreateAddresses()); Assert.assertEquals(AddressSettings.DEFAULT_AUTO_CREATE_ADDRESSES, addressSettings.isAutoCreateAddresses());
Assert.assertEquals(AddressSettings.DEFAULT_AUTO_DELETE_ADDRESSES, addressSettings.isAutoDeleteAddresses()); Assert.assertEquals(AddressSettings.DEFAULT_AUTO_DELETE_ADDRESSES, addressSettings.isAutoDeleteAddresses());
Assert.assertEquals(ActiveMQDefaultConfiguration.getDefaultDeleteQueueOnNoConsumers(), addressSettings.isDefaultDeleteOnNoConsumers()); Assert.assertEquals(ActiveMQDefaultConfiguration.getDefaultPurgeOnNoConsumers(), addressSettings.isDefaultPurgeOnNoConsumers());
Assert.assertEquals(ActiveMQDefaultConfiguration.getDefaultMaxQueueConsumers(), addressSettings.getDefaultMaxConsumers()); Assert.assertEquals(ActiveMQDefaultConfiguration.getDefaultMaxQueueConsumers(), addressSettings.getDefaultMaxConsumers());
} }

View File

@ -272,7 +272,7 @@
<auto-delete-queues>true</auto-delete-queues> <auto-delete-queues>true</auto-delete-queues>
<auto-create-addresses>true</auto-create-addresses> <auto-create-addresses>true</auto-create-addresses>
<auto-delete-addresses>true</auto-delete-addresses> <auto-delete-addresses>true</auto-delete-addresses>
<default-delete-on-no-consumers>false</default-delete-on-no-consumers> <default-purge-on-no-consumers>false</default-purge-on-no-consumers>
<default-max-consumers>5</default-max-consumers> <default-max-consumers>5</default-max-consumers>
<default-queue-routing-type>ANYCAST</default-queue-routing-type> <default-queue-routing-type>ANYCAST</default-queue-routing-type>
<default-address-routing-type>MULTICAST</default-address-routing-type> <default-address-routing-type>MULTICAST</default-address-routing-type>
@ -296,7 +296,7 @@
<auto-delete-queues>false</auto-delete-queues> <auto-delete-queues>false</auto-delete-queues>
<auto-create-addresses>false</auto-create-addresses> <auto-create-addresses>false</auto-create-addresses>
<auto-delete-addresses>false</auto-delete-addresses> <auto-delete-addresses>false</auto-delete-addresses>
<default-delete-on-no-consumers>true</default-delete-on-no-consumers> <default-purge-on-no-consumers>true</default-purge-on-no-consumers>
<default-max-consumers>15</default-max-consumers> <default-max-consumers>15</default-max-consumers>
<default-queue-routing-type>MULTICAST</default-queue-routing-type> <default-queue-routing-type>MULTICAST</default-queue-routing-type>
<default-address-routing-type>ANYCAST</default-address-routing-type> <default-address-routing-type>ANYCAST</default-address-routing-type>
@ -321,7 +321,7 @@
<durable>false</durable> <durable>false</durable>
<filter string="color='blue'"/> <filter string="color='blue'"/>
</queue> </queue>
<queue name="q2" max-consumers="-1" delete-on-no-consumers="false"> <queue name="q2" max-consumers="-1" purge-on-no-consumers="false">
<durable>true</durable> <durable>true</durable>
<filter string="color='green'"/> <filter string="color='green'"/>
</queue> </queue>
@ -332,7 +332,7 @@
<queue name="q3" max-consumers="10" > <queue name="q3" max-consumers="10" >
<filter string="color='red'"/> <filter string="color='red'"/>
</queue> </queue>
<queue name="q4" delete-on-no-consumers="true"> <queue name="q4" purge-on-no-consumers="true">
<durable>true</durable> <durable>true</durable>
</queue> </queue>
</multicast> </multicast>

View File

@ -29,7 +29,7 @@ public class Address {
private String defaultMaxConsumers = "-1"; private String defaultMaxConsumers = "-1";
private String defaultDeleteOnNoConsumers = "false"; private String defaultPurgeOnNoConsumers = "false";
private List<Queue> queues = new ArrayList<>(); private List<Queue> queues = new ArrayList<>();

View File

@ -2593,7 +2593,7 @@
</xsd:all> </xsd:all>
<xsd:attribute name="name" type="xsd:ID" use="required"/> <xsd:attribute name="name" type="xsd:ID" use="required"/>
<xsd:attribute name="max-consumers" type="xsd:integer" use="optional"/> <xsd:attribute name="max-consumers" type="xsd:integer" use="optional"/>
<xsd:attribute name="delete-on-no-consumers" type="xsd:boolean" use="optional"/> <xsd:attribute name="purge-on-no-consumers" type="xsd:boolean" use="optional"/>
</xsd:complexType> </xsd:complexType>
<xsd:complexType name="addressType"> <xsd:complexType name="addressType">

View File

@ -223,13 +223,13 @@ public class AddressingTest extends ActiveMQTestBase {
} }
@Test @Test
public void testDeleteQueueOnNoConsumersTrue() throws Exception { public void testPurgeOnNoConsumersTrue() throws Exception {
SimpleString address = new SimpleString("test.address"); SimpleString address = new SimpleString("test.address");
SimpleString queueName = SimpleString.toSimpleString(UUID.randomUUID().toString()); SimpleString queueName = SimpleString.toSimpleString(UUID.randomUUID().toString());
// For each address, create 2 Queues with the same address, assert both queues receive message // For each address, create 2 Queues with the same address, assert both queues receive message
boolean deleteOnNoConsumers = true; boolean purgeOnNoConsumers = true;
Queue q1 = server.createQueue(address, RoutingType.MULTICAST, queueName, null, true, false, Queue.MAX_CONSUMERS_UNLIMITED, deleteOnNoConsumers, true); Queue q1 = server.createQueue(address, RoutingType.MULTICAST, queueName, null, true, false, Queue.MAX_CONSUMERS_UNLIMITED, purgeOnNoConsumers, true);
ClientSession session = sessionFactory.createSession(); ClientSession session = sessionFactory.createSession();
session.start(); session.start();
@ -241,12 +241,12 @@ public class AddressingTest extends ActiveMQTestBase {
} }
@Test @Test
public void testDeleteQueueOnNoConsumersFalse() throws Exception { public void testPurgeOnNoConsumersFalse() throws Exception {
SimpleString address = new SimpleString("test.address"); SimpleString address = new SimpleString("test.address");
SimpleString queueName = SimpleString.toSimpleString(UUID.randomUUID().toString()); SimpleString queueName = SimpleString.toSimpleString(UUID.randomUUID().toString());
// For each address, create 2 Queues with the same address, assert both queues receive message // For each address, create 2 Queues with the same address, assert both queues receive message
boolean deleteOnNoConsumers = false; boolean purgeOnNoConsumers = false;
Queue q1 = server.createQueue(address,RoutingType.MULTICAST, queueName, null, true, false, Queue.MAX_CONSUMERS_UNLIMITED, deleteOnNoConsumers, true); Queue q1 = server.createQueue(address,RoutingType.MULTICAST, queueName, null, true, false, Queue.MAX_CONSUMERS_UNLIMITED, purgeOnNoConsumers, true);
ClientSession session = sessionFactory.createSession(); ClientSession session = sessionFactory.createSession();
session.start(); session.start();
@ -262,8 +262,8 @@ public class AddressingTest extends ActiveMQTestBase {
SimpleString address = new SimpleString("test.address"); SimpleString address = new SimpleString("test.address");
SimpleString queueName = SimpleString.toSimpleString(UUID.randomUUID().toString()); SimpleString queueName = SimpleString.toSimpleString(UUID.randomUUID().toString());
// For each address, create 2 Queues with the same address, assert both queues receive message // For each address, create 2 Queues with the same address, assert both queues receive message
boolean deleteOnNoConsumers = false; boolean purgeOnNoConsumers = false;
Queue q1 = server.createQueue(address, RoutingType.MULTICAST, queueName, null, true, false, 0, deleteOnNoConsumers, true); Queue q1 = server.createQueue(address, RoutingType.MULTICAST, queueName, null, true, false, 0, purgeOnNoConsumers, true);
Exception expectedException = null; Exception expectedException = null;
String expectedMessage = "Maximum Consumer Limit Reached on Queue"; String expectedMessage = "Maximum Consumer Limit Reached on Queue";
@ -288,8 +288,8 @@ public class AddressingTest extends ActiveMQTestBase {
SimpleString address = new SimpleString("test.address"); SimpleString address = new SimpleString("test.address");
SimpleString queueName = SimpleString.toSimpleString(UUID.randomUUID().toString()); SimpleString queueName = SimpleString.toSimpleString(UUID.randomUUID().toString());
// For each address, create 2 Queues with the same address, assert both queues receive message // For each address, create 2 Queues with the same address, assert both queues receive message
boolean deleteOnNoConsumers = false; boolean purgeOnNoConsumers = false;
Queue q1 = server.createQueue(address, RoutingType.MULTICAST, queueName, null, true, false, Queue.MAX_CONSUMERS_UNLIMITED, deleteOnNoConsumers, true); Queue q1 = server.createQueue(address, RoutingType.MULTICAST, queueName, null, true, false, Queue.MAX_CONSUMERS_UNLIMITED, purgeOnNoConsumers, true);
ClientSession session = sessionFactory.createSession(); ClientSession session = sessionFactory.createSession();
session.start(); session.start();

View File

@ -76,7 +76,7 @@ public class QueueCommandTest extends JMSTestBase {
Queue queue = server.locateQueue(new SimpleString(queueName)); Queue queue = server.locateQueue(new SimpleString(queueName));
assertEquals(-1, queue.getMaxConsumers()); assertEquals(-1, queue.getMaxConsumers());
assertEquals(false, queue.isDeleteOnNoConsumers()); assertEquals(false, queue.isPurgeOnNoConsumers());
assertTrue(server.queueQuery(new SimpleString(queueName)).isExists()); assertTrue(server.queueQuery(new SimpleString(queueName)).isExists());
} }
@ -100,7 +100,7 @@ public class QueueCommandTest extends JMSTestBase {
Queue queue = server.locateQueue(new SimpleString(queueName)); Queue queue = server.locateQueue(new SimpleString(queueName));
assertEquals(-1, queue.getMaxConsumers()); assertEquals(-1, queue.getMaxConsumers());
assertEquals(false, queue.isDeleteOnNoConsumers()); assertEquals(false, queue.isPurgeOnNoConsumers());
assertTrue(server.queueQuery(new SimpleString(queueName)).isExists()); assertTrue(server.queueQuery(new SimpleString(queueName)).isExists());
} }
@ -245,17 +245,17 @@ public class QueueCommandTest extends JMSTestBase {
final SimpleString addressSimpleString = new SimpleString(addressName); final SimpleString addressSimpleString = new SimpleString(addressName);
final int oldMaxConsumers = -1; final int oldMaxConsumers = -1;
final RoutingType oldRoutingType = RoutingType.MULTICAST; final RoutingType oldRoutingType = RoutingType.MULTICAST;
final boolean oldDeleteOnNoConsumers = false; final boolean oldPurgeOnNoConsumers = false;
final AddressInfo addressInfo = new AddressInfo(addressSimpleString, EnumSet.of(RoutingType.ANYCAST, RoutingType.MULTICAST)); final AddressInfo addressInfo = new AddressInfo(addressSimpleString, EnumSet.of(RoutingType.ANYCAST, RoutingType.MULTICAST));
server.addAddressInfo(addressInfo); server.addAddressInfo(addressInfo);
server.createQueue(addressSimpleString, oldRoutingType, queueNameString, null, true, false, oldMaxConsumers, oldDeleteOnNoConsumers, false); server.createQueue(addressSimpleString, oldRoutingType, queueNameString, null, true, false, oldMaxConsumers, oldPurgeOnNoConsumers, false);
final int newMaxConsumers = 1; final int newMaxConsumers = 1;
final RoutingType newRoutingType = RoutingType.ANYCAST; final RoutingType newRoutingType = RoutingType.ANYCAST;
final boolean newDeleteOnNoConsumers = true; final boolean newPurgeOnNoConsumers = true;
final UpdateQueue updateQueue = new UpdateQueue(); final UpdateQueue updateQueue = new UpdateQueue();
updateQueue.setName(queueName); updateQueue.setName(queueName);
updateQueue.setDeleteOnNoConsumers(newDeleteOnNoConsumers); updateQueue.setPurgeOnNoConsumers(newPurgeOnNoConsumers);
updateQueue.setAnycast(true); updateQueue.setAnycast(true);
updateQueue.setMulticast(false); updateQueue.setMulticast(false);
updateQueue.setMaxConsumers(newMaxConsumers); updateQueue.setMaxConsumers(newMaxConsumers);
@ -266,7 +266,7 @@ public class QueueCommandTest extends JMSTestBase {
final QueueQueryResult queueQueryResult = server.queueQuery(queueNameString); final QueueQueryResult queueQueryResult = server.queueQuery(queueNameString);
assertEquals("maxConsumers", newMaxConsumers, queueQueryResult.getMaxConsumers()); assertEquals("maxConsumers", newMaxConsumers, queueQueryResult.getMaxConsumers());
assertEquals("routingType", newRoutingType, queueQueryResult.getRoutingType()); assertEquals("routingType", newRoutingType, queueQueryResult.getRoutingType());
assertTrue("deleteOnNoConsumers", newDeleteOnNoConsumers == queueQueryResult.isDeleteOnNoConsumers()); assertTrue("purgeOnNoConsumers", newPurgeOnNoConsumers == queueQueryResult.isPurgeOnNoConsumers());
} }
@Test @Test
@ -277,11 +277,11 @@ public class QueueCommandTest extends JMSTestBase {
final SimpleString addressSimpleString = new SimpleString(addressName); final SimpleString addressSimpleString = new SimpleString(addressName);
final int oldMaxConsumers = 10; final int oldMaxConsumers = 10;
final RoutingType oldRoutingType = RoutingType.MULTICAST; final RoutingType oldRoutingType = RoutingType.MULTICAST;
final boolean oldDeleteOnNoConsumers = false; final boolean oldPurgeOnNoConsumers = false;
final Set<RoutingType> supportedRoutingTypes = EnumSet.of(oldRoutingType); final Set<RoutingType> supportedRoutingTypes = EnumSet.of(oldRoutingType);
final AddressInfo addressInfo = new AddressInfo(addressSimpleString, EnumSet.copyOf(supportedRoutingTypes)); final AddressInfo addressInfo = new AddressInfo(addressSimpleString, EnumSet.copyOf(supportedRoutingTypes));
server.addAddressInfo(addressInfo); server.addAddressInfo(addressInfo);
server.createQueue(addressSimpleString, oldRoutingType, queueNameString, null, true, false, oldMaxConsumers, oldDeleteOnNoConsumers, false); server.createQueue(addressSimpleString, oldRoutingType, queueNameString, null, true, false, oldMaxConsumers, oldPurgeOnNoConsumers, false);
final RoutingType newRoutingType = RoutingType.ANYCAST; final RoutingType newRoutingType = RoutingType.ANYCAST;
final UpdateQueue updateQueue = new UpdateQueue(); final UpdateQueue updateQueue = new UpdateQueue();
@ -296,7 +296,7 @@ public class QueueCommandTest extends JMSTestBase {
final QueueQueryResult queueQueryResult = server.queueQuery(queueNameString); final QueueQueryResult queueQueryResult = server.queueQuery(queueNameString);
assertEquals("maxConsumers", oldMaxConsumers, queueQueryResult.getMaxConsumers()); assertEquals("maxConsumers", oldMaxConsumers, queueQueryResult.getMaxConsumers());
assertEquals("routingType", oldRoutingType, queueQueryResult.getRoutingType()); assertEquals("routingType", oldRoutingType, queueQueryResult.getRoutingType());
assertTrue("deleteOnNoConsumers", oldDeleteOnNoConsumers == queueQueryResult.isDeleteOnNoConsumers()); assertTrue("purgeOnNoConsumers", oldPurgeOnNoConsumers == queueQueryResult.isPurgeOnNoConsumers());
} }
@Test @Test
@ -307,10 +307,10 @@ public class QueueCommandTest extends JMSTestBase {
final SimpleString addressSimpleString = new SimpleString(addressName); final SimpleString addressSimpleString = new SimpleString(addressName);
final int oldMaxConsumers = 2; final int oldMaxConsumers = 2;
final RoutingType oldRoutingType = RoutingType.MULTICAST; final RoutingType oldRoutingType = RoutingType.MULTICAST;
final boolean oldDeleteOnNoConsumers = false; final boolean oldPurgeOnNoConsumers = false;
final AddressInfo addressInfo = new AddressInfo(addressSimpleString, oldRoutingType); final AddressInfo addressInfo = new AddressInfo(addressSimpleString, oldRoutingType);
server.addAddressInfo(addressInfo); server.addAddressInfo(addressInfo);
server.createQueue(addressSimpleString, oldRoutingType, queueNameString, null, true, false, oldMaxConsumers, oldDeleteOnNoConsumers, false); server.createQueue(addressSimpleString, oldRoutingType, queueNameString, null, true, false, oldMaxConsumers, oldPurgeOnNoConsumers, false);
server.locateQueue(queueNameString).addConsumer(new DummyServerConsumer()); server.locateQueue(queueNameString).addConsumer(new DummyServerConsumer());
server.locateQueue(queueNameString).addConsumer(new DummyServerConsumer()); server.locateQueue(queueNameString).addConsumer(new DummyServerConsumer());

View File

@ -228,13 +228,13 @@ public class HangConsumerTest extends ActiveMQTestBase {
final boolean autoCreated, final boolean autoCreated,
final RoutingType deliveryMode, final RoutingType deliveryMode,
final Integer maxConsumers, final Integer maxConsumers,
final Boolean deleteOnNoConsumers, final Boolean purgeOnNoConsumers,
final ScheduledExecutorService scheduledExecutor, final ScheduledExecutorService scheduledExecutor,
final PostOffice postOffice, final PostOffice postOffice,
final StorageManager storageManager, final StorageManager storageManager,
final HierarchicalRepository<AddressSettings> addressSettingsRepository, final HierarchicalRepository<AddressSettings> addressSettingsRepository,
final Executor executor) { final Executor executor) {
super(id, address, name, filter, pageSubscription, user, durable, temporary, autoCreated, deliveryMode, maxConsumers, deleteOnNoConsumers, scheduledExecutor, postOffice, storageManager, addressSettingsRepository, executor); super(id, address, name, filter, pageSubscription, user, durable, temporary, autoCreated, deliveryMode, maxConsumers, purgeOnNoConsumers, scheduledExecutor, postOffice, storageManager, addressSettingsRepository, executor);
} }
@Override @Override
@ -261,7 +261,7 @@ public class HangConsumerTest extends ActiveMQTestBase {
@Override @Override
public Queue createQueueWith(final QueueConfig config) { public Queue createQueueWith(final QueueConfig config) {
queue = new MyQueueWithBlocking(config.id(), config.address(), config.name(), config.filter(), config.user(), config.pageSubscription(), config.isDurable(), config.isTemporary(), config.isAutoCreated(), config.deliveryMode(), config.maxConsumers(), config.isDeleteOnNoConsumers(), scheduledExecutor, postOffice, storageManager, addressSettingsRepository, executorFactory.getExecutor()); queue = new MyQueueWithBlocking(config.id(), config.address(), config.name(), config.filter(), config.user(), config.pageSubscription(), config.isDurable(), config.isTemporary(), config.isAutoCreated(), config.deliveryMode(), config.maxConsumers(), config.isPurgeOnNoConsumers(), scheduledExecutor, postOffice, storageManager, addressSettingsRepository, executorFactory.getExecutor());
return queue; return queue;
} }

View File

@ -544,7 +544,7 @@ public abstract class ClusterTestBase extends ActiveMQTestBase {
final String address, final String address,
final RoutingType routingType, final RoutingType routingType,
final int defaulMaxConsumers, final int defaulMaxConsumers,
boolean defaultDeleteOnNoConsumers) throws Exception { boolean defaultPurgeOnNoConsumers) throws Exception {
AddressInfo addressInfo = new AddressInfo(new SimpleString(address)); AddressInfo addressInfo = new AddressInfo(new SimpleString(address));
addressInfo.addRoutingType(routingType); addressInfo.addRoutingType(routingType);
servers[node].addOrUpdateAddressInfo(addressInfo); servers[node].addOrUpdateAddressInfo(addressInfo);

View File

@ -141,7 +141,7 @@ public class JmsProducerTest extends JMSTestBase {
public void defaultAutoCreatedQueueConfigTest() throws Exception { public void defaultAutoCreatedQueueConfigTest() throws Exception {
final String queueName = "q1"; final String queueName = "q1";
server.getAddressSettingsRepository().addMatch(queueName, new AddressSettings().setDefaultMaxConsumers(5).setDefaultDeleteOnNoConsumers(true)); server.getAddressSettingsRepository().addMatch(queueName, new AddressSettings().setDefaultMaxConsumers(5).setDefaultPurgeOnNoConsumers(true));
Queue q1 = context.createQueue(queueName); Queue q1 = context.createQueue(queueName);
@ -150,14 +150,14 @@ public class JmsProducerTest extends JMSTestBase {
org.apache.activemq.artemis.core.server.Queue queue = server.locateQueue(SimpleString.toSimpleString(queueName)); org.apache.activemq.artemis.core.server.Queue queue = server.locateQueue(SimpleString.toSimpleString(queueName));
assertEquals(5, queue.getMaxConsumers()); assertEquals(5, queue.getMaxConsumers());
assertEquals(true, queue.isDeleteOnNoConsumers()); assertEquals(true, queue.isPurgeOnNoConsumers());
} }
@Test @Test
public void defaultAutoCreatedQueueConfigTest2() throws Exception { public void defaultAutoCreatedQueueConfigTest2() throws Exception {
final String queueName = "q1"; final String queueName = "q1";
server.getAddressSettingsRepository().addMatch(queueName, new AddressSettings().setDefaultMaxConsumers(5).setDefaultDeleteOnNoConsumers(true)); server.getAddressSettingsRepository().addMatch(queueName, new AddressSettings().setDefaultMaxConsumers(5).setDefaultPurgeOnNoConsumers(true));
Connection connection = cf.createConnection(); Connection connection = cf.createConnection();
@ -168,7 +168,7 @@ public class JmsProducerTest extends JMSTestBase {
org.apache.activemq.artemis.core.server.Queue queue = server.locateQueue(SimpleString.toSimpleString(queueName)); org.apache.activemq.artemis.core.server.Queue queue = server.locateQueue(SimpleString.toSimpleString(queueName));
assertEquals(5, queue.getMaxConsumers()); assertEquals(5, queue.getMaxConsumers());
assertEquals(true, queue.isDeleteOnNoConsumers()); assertEquals(true, queue.isPurgeOnNoConsumers());
connection.close(); connection.close();
} }

View File

@ -748,7 +748,7 @@ public class JmsConsumerTest extends JMSTestBase {
server.getAddressSettingsRepository() server.getAddressSettingsRepository()
.addMatch(queueName, new AddressSettings() .addMatch(queueName, new AddressSettings()
.setDefaultMaxConsumers(5) .setDefaultMaxConsumers(5)
.setDefaultDeleteOnNoConsumers(true)); .setDefaultPurgeOnNoConsumers(true));
Connection connection = cf.createConnection(); Connection connection = cf.createConnection();
@ -759,7 +759,7 @@ public class JmsConsumerTest extends JMSTestBase {
org.apache.activemq.artemis.core.server.Queue queue = server.locateQueue(SimpleString.toSimpleString(queueName)); org.apache.activemq.artemis.core.server.Queue queue = server.locateQueue(SimpleString.toSimpleString(queueName));
assertEquals(5, queue.getMaxConsumers()); assertEquals(5, queue.getMaxConsumers());
assertEquals(true, queue.isDeleteOnNoConsumers()); assertEquals(true, queue.isPurgeOnNoConsumers());
connection.close(); connection.close();
} }

View File

@ -259,7 +259,7 @@ public class ActiveMQServerControlTest extends ManagementTestBase {
SimpleString address = RandomUtil.randomSimpleString(); SimpleString address = RandomUtil.randomSimpleString();
SimpleString name = RandomUtil.randomSimpleString(); SimpleString name = RandomUtil.randomSimpleString();
boolean durable = RandomUtil.randomBoolean(); boolean durable = RandomUtil.randomBoolean();
boolean deleteOnNoConsumers = RandomUtil.randomBoolean(); boolean purgeOnNoConsumers = RandomUtil.randomBoolean();
boolean autoCreateAddress = true; boolean autoCreateAddress = true;
int maxConsumers = RandomUtil.randomInt(); int maxConsumers = RandomUtil.randomInt();
@ -267,7 +267,7 @@ public class ActiveMQServerControlTest extends ManagementTestBase {
checkNoResource(ObjectNameBuilder.DEFAULT.getQueueObjectName(address, name, RoutingType.ANYCAST)); checkNoResource(ObjectNameBuilder.DEFAULT.getQueueObjectName(address, name, RoutingType.ANYCAST));
serverControl.createAddress(address.toString(), "ANYCAST"); serverControl.createAddress(address.toString(), "ANYCAST");
serverControl.createQueue(address.toString(), RoutingType.ANYCAST.toString(), name.toString(), null, durable, maxConsumers, deleteOnNoConsumers, autoCreateAddress); serverControl.createQueue(address.toString(), RoutingType.ANYCAST.toString(), name.toString(), null, durable, maxConsumers, purgeOnNoConsumers, autoCreateAddress);
checkResource(ObjectNameBuilder.DEFAULT.getQueueObjectName(address, name, RoutingType.ANYCAST)); checkResource(ObjectNameBuilder.DEFAULT.getQueueObjectName(address, name, RoutingType.ANYCAST));
QueueControl queueControl = ManagementControlHelper.createQueueControl(address, name, RoutingType.ANYCAST, mbeanServer); QueueControl queueControl = ManagementControlHelper.createQueueControl(address, name, RoutingType.ANYCAST, mbeanServer);
@ -275,7 +275,7 @@ public class ActiveMQServerControlTest extends ManagementTestBase {
Assert.assertEquals(name.toString(), queueControl.getName()); Assert.assertEquals(name.toString(), queueControl.getName());
Assert.assertNull(queueControl.getFilter()); Assert.assertNull(queueControl.getFilter());
Assert.assertEquals(durable, queueControl.isDurable()); Assert.assertEquals(durable, queueControl.isDurable());
Assert.assertEquals(deleteOnNoConsumers, queueControl.isDeleteOnNoConsumers()); Assert.assertEquals(purgeOnNoConsumers, queueControl.isPurgeOnNoConsumers());
Assert.assertEquals(maxConsumers, queueControl.getMaxConsumers()); Assert.assertEquals(maxConsumers, queueControl.getMaxConsumers());
Assert.assertEquals(false, queueControl.isTemporary()); Assert.assertEquals(false, queueControl.isTemporary());

View File

@ -113,17 +113,17 @@ public class ActiveMQServerControlUsingCoreTest extends ActiveMQServerControlTes
String filterStr, String filterStr,
boolean durable, boolean durable,
int maxConsumers, int maxConsumers,
boolean deleteOnNoConsumers, boolean purgeOnNoConsumers,
boolean autoCreateAddress) throws Exception { boolean autoCreateAddress) throws Exception {
return (String) proxy.invokeOperation("createQueue", address, routingType, name, filterStr, durable, maxConsumers, deleteOnNoConsumers, autoCreateAddress); return (String) proxy.invokeOperation("createQueue", address, routingType, name, filterStr, durable, maxConsumers, purgeOnNoConsumers, autoCreateAddress);
} }
@Override @Override
public String updateQueue(@Parameter(name = "name", desc = "Name of the queue") String name, public String updateQueue(@Parameter(name = "name", desc = "Name of the queue") String name,
@Parameter(name = "routingType", desc = "The routing type used for this address, MULTICAST or ANYCAST") String routingType, @Parameter(name = "routingType", desc = "The routing type used for this address, MULTICAST or ANYCAST") String routingType,
@Parameter(name = "maxConsumers", desc = "The maximum number of consumers allowed on this queue at any one time") Integer maxConsumers, @Parameter(name = "maxConsumers", desc = "The maximum number of consumers allowed on this queue at any one time") Integer maxConsumers,
@Parameter(name = "deleteOnNoConsumers", desc = "Delete this queue when the last consumer disconnects") Boolean deleteOnNoConsumers) throws Exception { @Parameter(name = "purgeOnNoConsumers", desc = "Delete this queue when the last consumer disconnects") Boolean purgeOnNoConsumers) throws Exception {
return (String) proxy.invokeOperation("updateQueue", name, routingType, maxConsumers, deleteOnNoConsumers); return (String) proxy.invokeOperation("updateQueue", name, routingType, maxConsumers, purgeOnNoConsumers);
} }
@Override @Override

View File

@ -87,8 +87,8 @@ public class QueueControlUsingCoreTest extends QueueControlTest {
} }
@Override @Override
public boolean isDeleteOnNoConsumers() { public boolean isPurgeOnNoConsumers() {
return (Boolean) proxy.retrieveAttributeValue("deleteOnNoConsumers"); return (Boolean) proxy.retrieveAttributeValue("purgeOnNoConsumers");
} }
@Override @Override

View File

@ -1013,7 +1013,7 @@ public class MessageHeaderTest extends MessageHeaderTestBase {
boolean durable, boolean durable,
boolean autoCreated, boolean autoCreated,
int maxConsumers, int maxConsumers,
boolean deleteOnNoConsumers) throws ActiveMQException { boolean purgeOnNoConsumers) throws ActiveMQException {
} }
@ -1043,7 +1043,7 @@ public class MessageHeaderTest extends MessageHeaderTestBase {
boolean durable, boolean durable,
boolean autoCreated, boolean autoCreated,
int maxConsumers, int maxConsumers,
boolean deleteOnNoConsumers) throws ActiveMQException { boolean purgeOnNoConsumers) throws ActiveMQException {
} }

View File

@ -120,7 +120,7 @@ public class AbstractAdmin implements Admin {
public void createQueue(final String name) { public void createQueue(final String name) {
Boolean result; Boolean result;
try { try {
invokeSyncOperation(ResourceNames.BROKER, "createQueue", name, RoutingType.ANYCAST.toString(), name, null, true, ActiveMQDefaultConfiguration.getDefaultMaxQueueConsumers(), ActiveMQDefaultConfiguration.getDefaultDeleteQueueOnNoConsumers(), true); invokeSyncOperation(ResourceNames.BROKER, "createQueue", name, RoutingType.ANYCAST.toString(), name, null, true, ActiveMQDefaultConfiguration.getDefaultMaxQueueConsumers(), ActiveMQDefaultConfiguration.getDefaultPurgeOnNoConsumers(), true);
} catch (Exception e) { } catch (Exception e) {
throw new IllegalStateException(e); throw new IllegalStateException(e);
} }

View File

@ -39,7 +39,7 @@ import org.apache.activemq.artemis.utils.ReferenceCounter;
public class FakeQueue implements Queue { public class FakeQueue implements Queue {
@Override @Override
public void setDeleteOnNoConsumers(boolean value) { public void setPurgeOnNoConsumers(boolean value) {
} }
@ -455,7 +455,7 @@ public class FakeQueue implements Queue {
} }
@Override @Override
public boolean isDeleteOnNoConsumers() { public boolean isPurgeOnNoConsumers() {
return false; return false;
} }

View File

@ -46,7 +46,7 @@ public class FakePostOffice implements PostOffice {
public QueueBinding updateQueue(SimpleString name, public QueueBinding updateQueue(SimpleString name,
RoutingType routingType, RoutingType routingType,
Integer maxConsumers, Integer maxConsumers,
Boolean deleteOnNoConsumers) throws Exception { Boolean purgeOnNoConsumers) throws Exception {
return null; return null;
} }