Authored by tanling

federation的方式 升级版本

... ... @@ -13,7 +13,7 @@
<artifactId>yoho-message-sdk</artifactId>
<packaging>jar</packaging>
<name>yoho-message-sdk</name>
<version>1.1.0-SNAPSHOT</version>
<version>1.1.1-SNAPSHOT</version>
<dependencies>
<dependency>
... ...
... ... @@ -32,9 +32,9 @@ public class MessageProducerTemplate {
private AmqpTemplate amqpTemplate;
private final String TOPIC_EXCHAGE = "amq.topic";
// private final String TOPIC_EXCHAGE = "amq.topic";
// private final String FEDERATION_TOPIC_EXCHANGE = "yoho.federation.topic";
private final String FEDERATION_TOPIC_EXCHANGE = "yoho.federation.topic";
... ... @@ -112,11 +112,11 @@ public class MessageProducerTemplate {
byte[] body = JSON.toJSONString(object).getBytes(Charsets.toCharset("UTF-8"));
Message amqpMsg = new Message(body, properties);
if (asyncEnable) {
asycnSend(TOPIC_EXCHAGE, topic, amqpMsg);
asycnSend(FEDERATION_TOPIC_EXCHANGE, topic, amqpMsg);
} else {
this.amqpTemplate.send(TOPIC_EXCHAGE, topic, amqpMsg);
this.amqpTemplate.send(FEDERATION_TOPIC_EXCHANGE, topic, amqpMsg);
}
logger.debug("send mq message success. exchange:{}, topic:{}, message:{}", TOPIC_EXCHAGE, topic, object);
logger.debug("send mq message success. exchange:{}, topic:{}, message:{}", FEDERATION_TOPIC_EXCHANGE, topic, object);
}
private void asycnSend(String topicExchange, String topic, Message amqpMsg) {
... ...