}
public void testReRouteAllWithNullProducerExchange() throws Exception {
final ActiveMQQueue queue = new ActiveMQQueue("Reroute.From."+topic.getTopicName());
final MessageInterceptorRegistry registry = MessageInterceptorRegistry.getInstance().get(BrokerRegistry.getInstance().findFirst());
registry.addMessageInterceptorForTopic(topic.getTopicName(), new MessageInterceptor() {
@Override
public void intercept(ProducerBrokerExchange producerExchange, Message message) {
message.setDestination(queue);
try {
registry.injectMessage(producerExchange, message);
} catch (Exception e) {
e.printStackTrace();
}
}
});