|
@@ -12,6 +12,7 @@ import org.springframework.amqp.rabbit.annotation.Queue;
|
|
|
import org.springframework.amqp.rabbit.annotation.RabbitListener;
|
|
|
import org.springframework.amqp.rabbit.connection.CachingConnectionFactory;
|
|
|
import org.springframework.amqp.rabbit.core.RabbitTemplate;
|
|
|
+import org.springframework.amqp.support.converter.Jackson2JsonMessageConverter;
|
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
|
import org.springframework.beans.factory.annotation.Qualifier;
|
|
|
import org.springframework.stereotype.Component;
|
|
@@ -38,9 +39,11 @@ public class MessageSender {
|
|
|
}
|
|
|
|
|
|
public void sendToLevelOneMQ(String message) {
|
|
|
+ levelTwoConnectionFactory.setMessageConverter(new Jackson2JsonMessageConverter());
|
|
|
levelOneConnectionFactory.convertAndSend(rabbitMQProperties.getLevelOneSendQueue(),message);
|
|
|
}
|
|
|
public void sendToLevelTwoMQ(String message) {
|
|
|
+ levelTwoConnectionFactory.setMessageConverter(new Jackson2JsonMessageConverter());
|
|
|
levelTwoConnectionFactory.convertAndSend(rabbitMQProperties.getLevelTwoSendQueue(),message);
|
|
|
}
|
|
|
|