This closes #2878
This commit is contained in:
commit
367f18bee3
|
@ -3014,9 +3014,11 @@ public class ActiveMQServerImpl implements ActiveMQServer {
|
||||||
.collect(Collectors.toSet());
|
.collect(Collectors.toSet());
|
||||||
|
|
||||||
for (SimpleString addressName : listAddressNames()) {
|
for (SimpleString addressName : listAddressNames()) {
|
||||||
|
AddressInfo addressInfo = getAddressInfo(addressName);
|
||||||
AddressSettings addressSettings = getAddressSettingsRepository().getMatch(addressName.toString());
|
AddressSettings addressSettings = getAddressSettingsRepository().getMatch(addressName.toString());
|
||||||
|
|
||||||
if (!addressesInConfig.contains(addressName.toString()) && addressSettings.getConfigDeleteAddresses() == DeletionPolicy.FORCE) {
|
if (!addressesInConfig.contains(addressName.toString()) && addressInfo != null && !addressInfo.isAutoCreated() &&
|
||||||
|
addressSettings.getConfigDeleteAddresses() == DeletionPolicy.FORCE) {
|
||||||
for (Queue queue : listQueues(addressName)) {
|
for (Queue queue : listQueues(addressName)) {
|
||||||
ActiveMQServerLogger.LOGGER.undeployQueue(queue.getName());
|
ActiveMQServerLogger.LOGGER.undeployQueue(queue.getName());
|
||||||
try {
|
try {
|
||||||
|
|
|
@ -84,6 +84,8 @@ public class RedeployTest extends ActiveMQTestBase {
|
||||||
Assert.assertNotNull("Address wasn't autocreated accordingly", consumer.receive(5000));
|
Assert.assertNotNull("Address wasn't autocreated accordingly", consumer.receive(5000));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Assert.assertNotNull(getQueue(embeddedActiveMQ, "autoQueue"));
|
||||||
|
|
||||||
// this simulates a remote queue or other type being added that wouldnt get deleted, its not valid to have this happen but it can happen when addresses and queues are auto created in a clustered env
|
// this simulates a remote queue or other type being added that wouldnt get deleted, its not valid to have this happen but it can happen when addresses and queues are auto created in a clustered env
|
||||||
embeddedActiveMQ.getActiveMQServer().getPostOffice().addBinding(new RemoteQueueBindingImpl(5L,
|
embeddedActiveMQ.getActiveMQServer().getPostOffice().addBinding(new RemoteQueueBindingImpl(5L,
|
||||||
new SimpleString("autoQueue"),
|
new SimpleString("autoQueue"),
|
||||||
|
@ -117,6 +119,8 @@ public class RedeployTest extends ActiveMQTestBase {
|
||||||
|
|
||||||
Assert.assertTrue(tryConsume());
|
Assert.assertTrue(tryConsume());
|
||||||
|
|
||||||
|
Assert.assertNotNull(getQueue(embeddedActiveMQ, "autoQueue"));
|
||||||
|
|
||||||
factory = new ActiveMQConnectionFactory();
|
factory = new ActiveMQConnectionFactory();
|
||||||
try (Connection connection = factory.createConnection()) {
|
try (Connection connection = factory.createConnection()) {
|
||||||
Session session = connection.createSession();
|
Session session = connection.createSession();
|
||||||
|
|
Loading…
Reference in New Issue