use of org.springframework.amqp.core.TopicExchange in project microservices by pwillhan.
the class RabbitAdminExample method main.
public static void main(String[] args) {
CachingConnectionFactory factory = new CachingConnectionFactory("localhost");
RabbitAdmin admin = new RabbitAdmin(factory);
Queue queue = new Queue("test-queue");
admin.declareQueue(queue);
TopicExchange exchange = new TopicExchange("sample-topic-exchange");
admin.declareExchange(exchange);
admin.declareBinding(BindingBuilder.bind(queue).to(exchange).with("sample-key"));
factory.destroy();
}
Aggregations