Skip to content

Commit

Permalink
Update
Browse files Browse the repository at this point in the history
  • Loading branch information
a-dubaj committed Mar 31, 2022
1 parent 32d7595 commit a27c80c
Showing 1 changed file with 18 additions and 1 deletion.
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
package com.andrzejdubaj.rabbitmqdemoapp;

import org.springframework.amqp.core.Queue;
import org.springframework.amqp.core.*;
import org.springframework.amqp.rabbit.connection.CachingConnectionFactory;
import org.springframework.amqp.rabbit.connection.ConnectionFactory;
import org.springframework.amqp.rabbit.listener.MessageListenerContainer;
Expand All @@ -18,6 +18,23 @@ Queue myQueue() {
return new Queue(MY_QUEUE, true);
}

@Bean
Exchange myExchange() {
return ExchangeBuilder.topicExchange("TopicExchange")
.durable(true)
.build();
}

@Bean
Binding binding() {
//return new Binding(MY_QUEUE, Binding.DestinationType.QUEUE, "MyTopicExchange", "topic", null);
return BindingBuilder
.bind(myQueue())
.to(myExchange())
.with("topic")
.noargs();
}

@Bean
ConnectionFactory connectionFactory() {
CachingConnectionFactory cachingConnectionFactory = new CachingConnectionFactory("localhost");
Expand Down

0 comments on commit a27c80c

Please sign in to comment.