فهرست منبع

更改rabbit配置

xie.kaifeng 1 سال پیش
والد
کامیت
18c6048b6e

+ 5 - 1
mtp3-century/src/main/java/com/muchinfo/mtp3century/configuration/RabbitConfig.java

@@ -4,15 +4,19 @@ import org.springframework.amqp.core.Binding;
 import org.springframework.amqp.core.BindingBuilder;
 import org.springframework.amqp.core.Queue;
 import org.springframework.amqp.core.TopicExchange;
+import org.springframework.beans.factory.annotation.Value;
 import org.springframework.context.annotation.Bean;
 import org.springframework.context.annotation.Configuration;
 
 @Configuration
 public class RabbitConfig {
 
+    @Value("${rabbitmq.template.exchange}")
+    private String exchangeName;
+
     @Bean
     TopicExchange exchange() {
-        return new TopicExchange("entry");
+        return new TopicExchange(exchangeName);
     }
 
     @Bean

+ 1 - 1
mtp3-century/src/main/resources/application.yml

@@ -28,7 +28,7 @@ spring:
     password: guest
     virtual-host: test
     template:
-      exchange:
+      exchange: entry
 
   datasource:
     driver-class-name: oracle.jdbc.driver.OracleDriver