|
@@ -1,32 +0,0 @@
|
|
-package thyyxxk.webserver.rabbitmq;
|
|
|
|
-
|
|
|
|
-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.context.annotation.Bean;
|
|
|
|
-import org.springframework.context.annotation.Configuration;
|
|
|
|
-
|
|
|
|
-@Configuration
|
|
|
|
-public class RabbitConfig {
|
|
|
|
- public static final String TOPIC_QUEUE_NAME = "upload_response";
|
|
|
|
- public static final String TOPIC_EXCHANGE = "upload_exchange";
|
|
|
|
- public static final String TOPIC_ROUTING_KEY = "upload_key.*";
|
|
|
|
-
|
|
|
|
- @Bean
|
|
|
|
- public Queue createTopicQueue() {
|
|
|
|
- return new Queue(TOPIC_QUEUE_NAME);
|
|
|
|
- }
|
|
|
|
-
|
|
|
|
- @Bean
|
|
|
|
- TopicExchange defTopicExchange(){
|
|
|
|
- return new TopicExchange(TOPIC_EXCHANGE);
|
|
|
|
- }
|
|
|
|
-
|
|
|
|
- @Bean
|
|
|
|
- Binding bindingTopic() {
|
|
|
|
- return BindingBuilder.bind(createTopicQueue()).
|
|
|
|
- to(defTopicExchange()).
|
|
|
|
- with(TOPIC_ROUTING_KEY);
|
|
|
|
- }
|
|
|
|
-}
|
|
|