@Override public boolean updateAddressInfo(SimpleString address, EnumSet<RoutingType> routingTypes) throws Exception { if (getAddressInfo(address) == null) { return false; } //after the postOffice call, updatedAddressInfo could change further (concurrently)! postOffice.updateAddressInfo(address, routingTypes); return true; }
private void removeExtraAddressStores() throws Exception { SimpleString[] storeNames = pagingManager.getStoreNames(); if (storeNames != null && storeNames.length > 0) { for (SimpleString storeName : storeNames) { if (getAddressInfo(storeName) == null) { pagingManager.deletePageStore(storeName); } } } }
@Override public AddressInfo addOrUpdateAddressInfo(AddressInfo addressInfo) throws Exception { if (!addAddressInfo(addressInfo)) { updateAddressInfo(addressInfo.getName(), addressInfo.getRoutingTypes()); } return getAddressInfo(addressInfo.getName()); }
@Override public void removeAddressInfo(final SimpleString address, final SecurityAuth auth, boolean force) throws Exception { if (auth != null) { securityStore.check(address, CheckType.DELETE_ADDRESS, auth); } AddressInfo addressInfo = getAddressInfo(address); if (postOffice.removeAddressInfo(address, force) == null) { throw ActiveMQMessageBundle.BUNDLE.addressDoesNotExist(address); } long txID = storageManager.generateID(); storageManager.deleteAddressBinding(txID, addressInfo.getId()); storageManager.commitBindings(txID); pagingManager.deletePageStore(address); }
AddressInfo addressInfo = getAddressInfo(address); routingType = addressInfo.getRoutingTypes().size() == 1 ? addressInfo.getRoutingType() : getAddressSettingsRepository().getMatch(address.toString()).getDefaultQueueRoutingType(); if (routingType == null) {
private void deployAddressesFromConfiguration(Configuration configuration) throws Exception { for (CoreAddressConfiguration config : configuration.getAddressConfigurations()) { try { ActiveMQServerLogger.LOGGER.deployAddress(config.getName(), config.getRoutingTypes().toString()); SimpleString address = SimpleString.toSimpleString(config.getName()); AddressInfo tobe = new AddressInfo(address, config.getRoutingTypes()); //During this stage until all queues re-configured we combine the current (if exists) with to-be routing types to allow changes in queues AddressInfo current = getAddressInfo(address); AddressInfo merged = new AddressInfo(address, tobe.getRoutingType()); if (current != null) { merged.getRoutingTypes().addAll(current.getRoutingTypes()); } addOrUpdateAddressInfo(merged); deployQueuesFromListCoreQueueConfiguration(config.getQueueConfigurations()); //Now all queues updated we apply the actual address info expected tobe. addOrUpdateAddressInfo(tobe); } catch (Exception e) { ActiveMQServerLogger.LOGGER.problemDeployingAddress(config.getName(), e.getMessage()); } } }
AddressInfo info = getAddressInfo(realAddress);
removeConsumers, autoDeleteAddress)); AddressInfo addressInfo = getAddressInfo(address);