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();
}
}
});