private static SimpleString lastValueKey(final AddressSettings addressSettings) { if (addressSettings.getDefaultLastValueKey() != null && !addressSettings.getDefaultLastValueKey().isEmpty()) { return addressSettings.getDefaultLastValueKey(); } else if (addressSettings.isDefaultLastValueQueue()) { return Message.HDR_LAST_VALUE_NAME; } else { return null; } }
@Override public Queue createQueue(SimpleString address, RoutingType routingType, SimpleString queueName, SimpleString filter, SimpleString user, boolean durable, boolean temporary, boolean ignoreIfExists, boolean transientQueue, boolean autoCreated, int maxConsumers, boolean purgeOnNoConsumers, boolean exclusive, boolean lastValue, boolean autoCreateAddress) throws Exception { AddressSettings as = getAddressSettingsRepository().getMatch(address == null ? queueName.toString() : address.toString()); return createQueue(address, routingType, queueName, filter, user, durable, temporary, ignoreIfExists, transientQueue, autoCreated, maxConsumers, purgeOnNoConsumers, exclusive, lastValue, as.getDefaultLastValueKey(), as.isDefaultNonDestructive(), as.getDefaultConsumersBeforeDispatch(), as.getDefaultDelayBeforeDispatch(), autoCreateAddress); }
@Override public Queue createQueue(AddressInfo addressInfo, SimpleString queueName, SimpleString filter, SimpleString user, boolean durable, boolean temporary, boolean autoCreated, Integer maxConsumers, Boolean purgeOnNoConsumers, Boolean exclusive, Boolean lastValue, boolean autoCreateAddress) throws Exception { AddressSettings as = getAddressSettingsRepository().getMatch(addressInfo == null ? queueName.toString() : addressInfo.getName().toString()); return createQueue(addressInfo, queueName, filter, user, durable, temporary, false, false, autoCreated, maxConsumers, purgeOnNoConsumers, exclusive, lastValue, as.getDefaultLastValueKey(), as.isDefaultNonDestructive(), as.getDefaultConsumersBeforeDispatch(), as.getDefaultDelayBeforeDispatch(), autoCreateAddress, false); }
@Override public Queue createQueue(SimpleString address, RoutingType routingType, SimpleString queueName, SimpleString filter, SimpleString user, boolean durable, boolean temporary, boolean ignoreIfExists, boolean transientQueue, boolean autoCreated, int maxConsumers, boolean purgeOnNoConsumers, boolean autoCreateAddress) throws Exception { AddressSettings as = getAddressSettingsRepository().getMatch(address == null ? queueName.toString() : address.toString()); return createQueue(address, routingType, queueName, filter, user, durable, temporary, ignoreIfExists, transientQueue, autoCreated, maxConsumers, purgeOnNoConsumers, as.isDefaultExclusiveQueue(), as.isDefaultLastValueQueue(), as.getDefaultLastValueKey(), as.isDefaultNonDestructive(), as.getDefaultConsumersBeforeDispatch(), as.getDefaultDelayBeforeDispatch(), autoCreateAddress); }
@Override public String createQueue(String address, String routingType, String name, String filterStr, boolean durable, int maxConsumers, boolean purgeOnNoConsumers, boolean autoCreateAddress) throws Exception { AddressSettings addressSettings = server.getAddressSettingsRepository().getMatch(address == null ? name : address); return createQueue( address, routingType, name, filterStr, durable, maxConsumers, purgeOnNoConsumers, addressSettings.isDefaultExclusiveQueue(), addressSettings.isDefaultLastValueQueue(), addressSettings.getDefaultLastValueKey() == null ? null : addressSettings.getDefaultLastValueKey().toString(), addressSettings.isDefaultNonDestructive(), addressSettings.getDefaultConsumersBeforeDispatch(), addressSettings.getDefaultDelayBeforeDispatch(), autoCreateAddress ); }
@Override public Queue createQueue(AddressInfo addressInfo, SimpleString queueName, SimpleString filter, SimpleString user, boolean durable, boolean temporary, boolean autoCreated, Integer maxConsumers, Boolean purgeOnNoConsumers, boolean autoCreateAddress) throws Exception { AddressSettings as = getAddressSettingsRepository().getMatch(addressInfo == null ? queueName.toString() : addressInfo.getName().toString()); return createQueue(addressInfo, queueName, filter, user, durable, temporary, false, false, autoCreated, maxConsumers, purgeOnNoConsumers, as.isDefaultExclusiveQueue(), as.isDefaultLastValueQueue(), as.getDefaultLastValueKey(), as.isDefaultNonDestructive(), as.getDefaultConsumersBeforeDispatch(), as.getDefaultDelayBeforeDispatch(), autoCreateAddress, false); }
@Override public Queue createQueue(AddressInfo addressInfo, SimpleString name, SimpleString filterString, boolean temporary, boolean durable, boolean autoCreated) throws Exception { AddressSettings as = server.getAddressSettingsRepository().getMatch(addressInfo.getName().toString()); return createQueue(addressInfo, name, filterString, temporary, durable, as.getDefaultMaxConsumers(), as.isDefaultPurgeOnNoConsumers(), as.isDefaultExclusiveQueue(), as.isDefaultLastValueQueue(), as.getDefaultLastValueKey(), as.isDefaultNonDestructive(), as.getDefaultConsumersBeforeDispatch(), as.getDefaultDelayBeforeDispatch(), autoCreated); }
@Override public Queue createQueue(AddressInfo addressInfo, SimpleString name, SimpleString filterString, boolean temporary, boolean durable, Boolean exclusive, Boolean lastValue, boolean autoCreated) throws Exception { AddressSettings as = server.getAddressSettingsRepository().getMatch(addressInfo.getName().toString()); return createQueue(addressInfo, name, filterString, temporary, durable, as.getDefaultMaxConsumers(), as.isDefaultPurgeOnNoConsumers(), exclusive == null ? as.isDefaultExclusiveQueue() : exclusive, lastValue == null ? as.isDefaultLastValueQueue() : lastValue, as.getDefaultLastValueKey(), as.isDefaultNonDestructive(), as.getDefaultConsumersBeforeDispatch(), as.getDefaultDelayBeforeDispatch(), autoCreated); }
final boolean autoCreated) throws Exception { AddressSettings as = server.getAddressSettingsRepository().getMatch(address.toString()); return createQueue(new AddressInfo(address, routingType), name, filterString, temporary, durable, maxConsumers, purgeOnNoConsumers, as.isDefaultExclusiveQueue(), as.isDefaultLastValueQueue(), as.getDefaultLastValueKey(), as.isDefaultNonDestructive(), as.getDefaultConsumersBeforeDispatch(), as.getDefaultDelayBeforeDispatch(), autoCreated);
exclusive == null ? as.isDefaultExclusiveQueue() : exclusive, lastValue == null ? as.isDefaultLastValueQueue() : lastValue, lastValueKey == null ? as.getDefaultLastValueKey() : lastValueKey, nonDestructive == null ? as.isDefaultNonDestructive() : nonDestructive, consumersBeforeDispatch == null ? as.getDefaultConsumersBeforeDispatch() : consumersBeforeDispatch,
@Override public void createSharedQueue(final SimpleString address, RoutingType routingType, final SimpleString name, final SimpleString filterString, final SimpleString user, boolean durable, int maxConsumers, boolean purgeOnNoConsumers, boolean exclusive, boolean lastValue) throws Exception { AddressSettings as = getAddressSettingsRepository().getMatch(address == null ? name.toString() : address.toString()); createSharedQueue(address, routingType, name, filterString, user, durable, maxConsumers, purgeOnNoConsumers, exclusive, lastValue, as.getDefaultLastValueKey(), as.isDefaultNonDestructive(), as.getDefaultConsumersBeforeDispatch(), as.getDefaultDelayBeforeDispatch()); }
boolean defaultExclusive = addressSettings.isDefaultExclusiveQueue(); boolean defaultLastValue = addressSettings.isDefaultLastValueQueue(); SimpleString defaultLastValueKey = addressSettings.getDefaultLastValueKey(); boolean defaultNonDestructive = addressSettings.isDefaultNonDestructive(); int defaultConsumersBeforeDispatch = addressSettings.getDefaultConsumersBeforeDispatch();
@Override public void createSharedQueue(SimpleString address, SimpleString name, RoutingType routingType, SimpleString filterString, boolean durable, Integer maxConsumers, Boolean purgeOnNoConsumers, Boolean exclusive, Boolean lastValue, SimpleString lastValueKey, Boolean nonDestructive, Integer consumersBeforeDispatch, Long delayBeforeDispatch) throws Exception { address = removePrefix(address); securityCheck(address, name, durable ? CheckType.CREATE_DURABLE_QUEUE : CheckType.CREATE_NON_DURABLE_QUEUE, this); server.checkQueueCreationLimit(getUsername()); AddressSettings as = server.getAddressSettingsRepository().getMatch(address.toString()); server.createSharedQueue(address, routingType, name, filterString, SimpleString.toSimpleString(getUsername()), durable, maxConsumers == null ? as.getDefaultMaxConsumers() : maxConsumers, purgeOnNoConsumers == null ? as.isDefaultPurgeOnNoConsumers() : purgeOnNoConsumers, exclusive == null ? as.isDefaultExclusiveQueue() : exclusive, lastValue == null ? as.isDefaultLastValueQueue() : lastValue, lastValueKey == null ? as.getDefaultLastValueKey() : lastValueKey, nonDestructive == null ? as.isDefaultNonDestructive() : nonDestructive, consumersBeforeDispatch == null ? as.getDefaultConsumersBeforeDispatch() : consumersBeforeDispatch, delayBeforeDispatch == null ? as.getDefaultDelayBeforeDispatch() : delayBeforeDispatch); }
public Queue createQueue(final AddressInfo addressInfo, final SimpleString name, final SimpleString filterString, final boolean temporary, final boolean durable, final int maxConsumers, final boolean purgeOnNoConsumers, final boolean exclusive, final boolean lastValue, SimpleString lastValueKey, final boolean nonDestructive, final int consumersBeforeDispatch, final long delayBeforeDispatch, final boolean autoCreated) throws Exception { final SimpleString unPrefixedName = removePrefix(name); AddressInfo art = getAddressAndRoutingType(addressInfo); if (durable) { // make sure the user has privileges to create this queue securityCheck(addressInfo.getName(), name, CheckType.CREATE_DURABLE_QUEUE, this); } else { securityCheck(addressInfo.getName(), name, CheckType.CREATE_NON_DURABLE_QUEUE, this); } AddressSettings as = server.getAddressSettingsRepository().getMatch(art.getName().toString()); if (as.isAutoCreateAddresses() && server.getAddressInfo(art.getName()) == null) { securityCheck(addressInfo.getName(), name, CheckType.CREATE_ADDRESS, this); }
private void deployQueuesFromListCoreQueueConfiguration(List<CoreQueueConfiguration> queues) throws Exception { for (CoreQueueConfiguration config : queues) { try { SimpleString queueName = SimpleString.toSimpleString(config.getName()); ActiveMQServerLogger.LOGGER.deployQueue(config.getName(), config.getAddress(), config.getRoutingType().toString()); AddressSettings as = addressSettingsRepository.getMatch(config.getAddress()); // determine if there is an address::queue match; update it if so int maxConsumers = config.getMaxConsumers() == null ? as.getDefaultMaxConsumers() : config.getMaxConsumers(); boolean isExclusive = config.isExclusive() == null ? as.isDefaultExclusiveQueue() : config.isExclusive(); boolean isLastValue = config.isLastValue() == null ? as.isDefaultLastValueQueue() : config.isLastValue(); SimpleString lastValueKey = config.getLastValueKey() == null ? as.getDefaultLastValueKey() : SimpleString.toSimpleString(config.getLastValueKey()); boolean isNonDestructive = config.isNonDestructive() == null ? as.isDefaultNonDestructive() : config.isNonDestructive(); int consumersBeforeDispatch = config.getConsumersBeforeDispatch() == null ? as.getDefaultConsumersBeforeDispatch() : config.getConsumersBeforeDispatch(); long delayBeforeDispatch = config.getDelayBeforeDispatch() == null ? as.getDefaultDelayBeforeDispatch() : config.getDelayBeforeDispatch(); if (locateQueue(queueName) != null && locateQueue(queueName).getAddress().toString().equals(config.getAddress())) { updateQueue(config.getName(), config.getRoutingType(), config.getFilterString(), maxConsumers, config.getPurgeOnNoConsumers(), isExclusive, isNonDestructive, consumersBeforeDispatch, delayBeforeDispatch, config.getUser(), true); } else { // if the address::queue doesn't exist then create it try { createQueue(new AddressInfo(SimpleString.toSimpleString(config.getAddress())).addRoutingType(config.getRoutingType()), queueName, SimpleString.toSimpleString(config.getFilterString()), SimpleString.toSimpleString(config.getUser()), config.isDurable(), false, false, false, false, maxConsumers, config.getPurgeOnNoConsumers(), isExclusive, isLastValue, lastValueKey, isNonDestructive, consumersBeforeDispatch, delayBeforeDispatch, true, true); } catch (ActiveMQQueueExistsException e) { // the queue may exist on a *different* address ActiveMQServerLogger.LOGGER.warn(e.getMessage()); } } } catch (Exception e) { ActiveMQServerLogger.LOGGER.problemDeployingQueue(config.getName(), e.getMessage()); } } }
boolean defaultExclusiveQueue = addressSettings.isDefaultExclusiveQueue(); boolean defaultLastValueQueue = addressSettings.isDefaultLastValueQueue(); SimpleString defaultLastValueKey = addressSettings.getDefaultLastValueKey(); boolean defaultNonDestructive = addressSettings.isDefaultNonDestructive(); int defaultConsumersBeforeDispatch = addressSettings.getDefaultConsumersBeforeDispatch();