|
@@ -5,6 +5,7 @@ import org.springframework.amqp.core.Binding;
|
|
|
import org.springframework.amqp.core.BindingBuilder;
|
|
|
import org.springframework.amqp.core.DirectExchange;
|
|
|
import org.springframework.amqp.core.Queue;
|
|
|
+import org.springframework.amqp.core.TopicExchange;
|
|
|
import org.springframework.amqp.support.converter.Jackson2JsonMessageConverter;
|
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
|
import org.springframework.beans.factory.annotation.Value;
|
|
@@ -19,6 +20,9 @@ public class RabbitMQConfig {
|
|
|
|
|
|
@Value("${rabbitmq.queue.name.recover}")
|
|
|
private String queueRecover;
|
|
|
+
|
|
|
+ @Value("${rabbitmq.queue.name.system}")
|
|
|
+ private String queueSystem;
|
|
|
|
|
|
@Value("${rabbitmq.exchange.name}")
|
|
|
private String exchange;
|
|
@@ -29,6 +33,9 @@ public class RabbitMQConfig {
|
|
|
@Value("${rabbitmq.routing.key.recover}")
|
|
|
private String routingKeyRecover;
|
|
|
|
|
|
+ @Value("${rabbitmq.routing.key.system}")
|
|
|
+ private String routingKeySystem;
|
|
|
+
|
|
|
@SuppressWarnings("unused")
|
|
|
@Autowired
|
|
|
private AmqpAdmin amqpAdmin;
|
|
@@ -38,10 +45,12 @@ public class RabbitMQConfig {
|
|
|
public void Configure() {
|
|
|
Queue q = new Queue(this.queueUser, true, false, false);
|
|
|
Queue q2 = new Queue(this.queueRecover, true, false, false);
|
|
|
+ Queue q3 = new Queue(this.queueSystem, true, false, false);
|
|
|
amqpAdmin.declareQueue(q);
|
|
|
amqpAdmin.declareQueue(q2);
|
|
|
+ amqpAdmin.declareQueue(q3);
|
|
|
|
|
|
- DirectExchange e = new DirectExchange(this.exchange);
|
|
|
+ TopicExchange e = new TopicExchange(this.exchange);
|
|
|
amqpAdmin.declareExchange(e);
|
|
|
|
|
|
amqpAdmin.declareBinding(BindingBuilder
|
|
@@ -53,6 +62,11 @@ public class RabbitMQConfig {
|
|
|
.bind(q2)
|
|
|
.to(e)
|
|
|
.with(routingKeyRecover));
|
|
|
+
|
|
|
+ amqpAdmin.declareBinding(BindingBuilder
|
|
|
+ .bind(q3)
|
|
|
+ .to(e)
|
|
|
+ .with(routingKeySystem));
|
|
|
}
|
|
|
|
|
|
@Bean
|