This closes #3145
This commit is contained in:
commit
0106e26036
|
@ -98,6 +98,8 @@ public interface ServiceRegistry {
|
|||
|
||||
void addDivertTransformer(String name, Transformer transformer);
|
||||
|
||||
void removeDivertTransformer(String name);
|
||||
|
||||
/**
|
||||
* Get an instance of org.apache.activemq.artemis.core.server.transformer.Transformer for a bridge
|
||||
*
|
||||
|
|
|
@ -2595,6 +2595,10 @@ public class ActiveMQServerImpl implements ActiveMQServer {
|
|||
}
|
||||
|
||||
postOffice.removeBinding(name, null, true);
|
||||
|
||||
if (((DivertBinding)binding).getDivert().getTransformer() != null) {
|
||||
getServiceRegistry().removeDivertTransformer(name.toString());
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
|
|
|
@ -156,6 +156,11 @@ public class ServiceRegistryImpl implements ServiceRegistry {
|
|||
divertTransformers.put(name, transformer);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void removeDivertTransformer(String name) {
|
||||
divertTransformers.remove(name);
|
||||
}
|
||||
|
||||
@Override
|
||||
public Transformer getDivertTransformer(String name, TransformerConfiguration transformerConfiguration) {
|
||||
Transformer transformer = divertTransformers.get(name);
|
||||
|
|
|
@ -1461,5 +1461,8 @@ public class DivertTest extends ActiveMQTestBase {
|
|||
}
|
||||
assertNotNull(divert);
|
||||
assertEquals(transformer, divert.getTransformer());
|
||||
|
||||
server.destroyDivert(SimpleString.toSimpleString(DIVERT));
|
||||
assertNull(serviceRegistry.getDivertTransformer(DIVERT, null));
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue