diff --git a/spring-amqp-core/src/main/java/org/springframework/amqp/core/BindingBuilder.java b/spring-amqp-core/src/main/java/org/springframework/amqp/core/BindingBuilder.java index ba673b24..db96d1db 100644 --- a/spring-amqp-core/src/main/java/org/springframework/amqp/core/BindingBuilder.java +++ b/spring-amqp-core/src/main/java/org/springframework/amqp/core/BindingBuilder.java @@ -29,11 +29,10 @@ import org.springframework.util.Assert; */ public final class BindingBuilder { - public static ExchangeConfigurer from(Queue queue) { + public static ExchangeConfigurer bind(Queue queue) { return new ExchangeConfigurer(queue); } - public static class ExchangeConfigurer { private final Queue queue; diff --git a/spring-amqp-core/src/test/java/org/springframework/amqp/core/BindingBuilderTests.java b/spring-amqp-core/src/test/java/org/springframework/amqp/core/BindingBuilderTests.java index ca239145..2627f4b8 100644 --- a/spring-amqp-core/src/test/java/org/springframework/amqp/core/BindingBuilderTests.java +++ b/spring-amqp-core/src/test/java/org/springframework/amqp/core/BindingBuilderTests.java @@ -27,25 +27,25 @@ public class BindingBuilderTests { @Test public void fanoutBinding() { - Binding binding = BindingBuilder.from(new Queue("q")).to(new FanoutExchange("f")); + Binding binding = BindingBuilder.bind(new Queue("q")).to(new FanoutExchange("f")); assertNotNull(binding); } @Test public void directBinding() { - Binding binding = BindingBuilder.from(new Queue("q")).to(new DirectExchange("d")).with("r"); + Binding binding = BindingBuilder.bind(new Queue("q")).to(new DirectExchange("d")).with("r"); assertNotNull(binding); } @Test public void directBindingWithQueueName() { - Binding binding = BindingBuilder.from(new Queue("q")).to(new DirectExchange("d")).withQueueName(); + Binding binding = BindingBuilder.bind(new Queue("q")).to(new DirectExchange("d")).withQueueName(); assertNotNull(binding); } @Test public void topicBinding() { - Binding binding = BindingBuilder.from(new Queue("q")).to(new TopicExchange("t")).with("r"); + Binding binding = BindingBuilder.bind(new Queue("q")).to(new TopicExchange("t")).with("r"); assertNotNull(binding); } diff --git a/spring-rabbit/src/test/java/org/springframework/amqp/rabbit/core/RabbitBindingIntegrationTests.java b/spring-rabbit/src/test/java/org/springframework/amqp/rabbit/core/RabbitBindingIntegrationTests.java index 0e0df111..263a19f6 100644 --- a/spring-rabbit/src/test/java/org/springframework/amqp/rabbit/core/RabbitBindingIntegrationTests.java +++ b/spring-rabbit/src/test/java/org/springframework/amqp/rabbit/core/RabbitBindingIntegrationTests.java @@ -40,7 +40,7 @@ public class RabbitBindingIntegrationTests { admin.declareExchange(exchange); template.setExchange(exchange.getName()); - admin.declareBinding(BindingBuilder.from(queue).to(exchange).with("*.end")); + admin.declareBinding(BindingBuilder.bind(queue).to(exchange).with("*.end")); template.execute(new ChannelCallback() { public Void doInRabbit(Channel channel) throws Exception { @@ -79,7 +79,7 @@ public class RabbitBindingIntegrationTests { final TopicExchange exchange = new TopicExchange("topic"); admin.declareExchange(exchange); - admin.declareBinding(BindingBuilder.from(queue).to(exchange).with("*.end")); + admin.declareBinding(BindingBuilder.bind(queue).to(exchange).with("*.end")); template.execute(new ChannelCallback() { public Void doInRabbit(Channel channel) throws Exception { @@ -119,7 +119,7 @@ public class RabbitBindingIntegrationTests { admin.declareExchange(exchange); template.setExchange(exchange.getName()); - admin.declareBinding(BindingBuilder.from(queue).to(exchange).with("*.end")); + admin.declareBinding(BindingBuilder.bind(queue).to(exchange).with("*.end")); final RabbitTemplate template = new RabbitTemplate(new CachingConnectionFactory()); template.setExchange(exchange.getName()); @@ -156,7 +156,7 @@ public class RabbitBindingIntegrationTests { admin.declareExchange(exchange); template.setExchange(exchange.getName()); - admin.declareBinding(BindingBuilder.from(queue).to(exchange).with("*.end")); + admin.declareBinding(BindingBuilder.bind(queue).to(exchange).with("*.end")); template.execute(new ChannelCallback() { public Void doInRabbit(Channel channel) throws Exception { @@ -208,7 +208,7 @@ public class RabbitBindingIntegrationTests { admin.declareExchange(exchange); template.setExchange(exchange.getName()); - admin.declareBinding(BindingBuilder.from(queue).to(exchange)); + admin.declareBinding(BindingBuilder.bind(queue).to(exchange)); template.execute(new ChannelCallback() { public Void doInRabbit(Channel channel) throws Exception { diff --git a/src/docbkx/amqp.xml b/src/docbkx/amqp.xml index 123d4397..4486bd6d 100644 --- a/src/docbkx/amqp.xml +++ b/src/docbkx/amqp.xml @@ -179,7 +179,7 @@ We also provide a BindingBuilder to facilitate a "fluent API" style. - + The BindingBuilder class is shown above for clarity, but this @@ -813,7 +813,7 @@ public class RabbitClientConfiguration extends AbstractStockAppRabbitConfigurati */ @Bean public Binding marketDataBinding() { - return BindingBuilder.from( + return BindingBuilder.bind( marketDataQueue()).to(marketDataExchange()).with(marketDataRoutingKey); } diff --git a/src/docbkx/sample-apps.xml b/src/docbkx/sample-apps.xml index 1f829011..147d3029 100644 --- a/src/docbkx/sample-apps.xml +++ b/src/docbkx/sample-apps.xml @@ -313,7 +313,7 @@ private String marketDataRoutingKey; @Bean public Binding marketDataBinding() { - return BindingBuilder.from( + return BindingBuilder.bind( marketDataQueue()).to(marketDataExchange()).with(marketDataRoutingKey); }]]>