This closes #933

This commit is contained in:
jbertram 2016-12-16 09:06:59 -06:00
commit 343cdefbd9
1 changed files with 10 additions and 4 deletions

View File

@ -2531,10 +2531,16 @@ public class ActiveMQServerImpl implements ActiveMQServer {
AddressInfo info = postOffice.getAddressInfo(addressName);
if (autoCreateAddress) {
if (info == null || !info.getRoutingTypes().contains(routingType)) {
final AddressInfo defaultAddressInfo = new AddressInfo(addressName);
defaultAddressInfo.addRoutingType(routingType == null ? ActiveMQDefaultConfiguration.getDefaultRoutingType() : routingType);
createOrUpdateAddressInfo(defaultAddressInfo.setAutoCreated(true));
RoutingType rt = (routingType == null ? ActiveMQDefaultConfiguration.getDefaultRoutingType() : routingType);
if (info == null) {
final AddressInfo addressInfo = new AddressInfo(addressName, rt);
createAddressInfo(addressInfo);
}
else if (!info.getRoutingTypes().contains(routingType)) {
Set<RoutingType> routingTypes = new HashSet<>();
routingTypes.addAll(info.getRoutingTypes());
routingTypes.add(routingType);
updateAddressInfo(info.getName().toString(), routingTypes);
}
} else if (info == null) {
throw ActiveMQMessageBundle.BUNDLE.addressDoesNotExist(addressName);