NO-JIRA Fix Issue with Auto Create Address
This commit is contained in:
parent
be38f4dd45
commit
3e0ad2268b
|
@ -2531,10 +2531,16 @@ public class ActiveMQServerImpl implements ActiveMQServer {
|
||||||
AddressInfo info = postOffice.getAddressInfo(addressName);
|
AddressInfo info = postOffice.getAddressInfo(addressName);
|
||||||
|
|
||||||
if (autoCreateAddress) {
|
if (autoCreateAddress) {
|
||||||
if (info == null || !info.getRoutingTypes().contains(routingType)) {
|
RoutingType rt = (routingType == null ? ActiveMQDefaultConfiguration.getDefaultRoutingType() : routingType);
|
||||||
final AddressInfo defaultAddressInfo = new AddressInfo(addressName);
|
if (info == null) {
|
||||||
defaultAddressInfo.addRoutingType(routingType == null ? ActiveMQDefaultConfiguration.getDefaultRoutingType() : routingType);
|
final AddressInfo addressInfo = new AddressInfo(addressName, rt);
|
||||||
createOrUpdateAddressInfo(defaultAddressInfo.setAutoCreated(true));
|
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) {
|
} else if (info == null) {
|
||||||
throw ActiveMQMessageBundle.BUNDLE.addressDoesNotExist(addressName);
|
throw ActiveMQMessageBundle.BUNDLE.addressDoesNotExist(addressName);
|
||||||
|
|
Loading…
Reference in New Issue