Handle binder config in BindingProperties

- Per-binding properties defined in `BindingProperties` need to hold the binder specific configurations needed when binding producer/consumers.
Previously, these were added in `ChannelBindingServiceProperties` as producer/consumer properties. Since these configuration properties are for
per-binding based on the input/output (consumer/producer) channel being bound it is better to move these properties into `BindingProperties`.
 - Add some of the supported producer/consumer properties into BindingProperties

- This fixes #256

Rename CommonBinderProperties -> BinderPropertyKeys

Rename class AbstractBinderPropertiesAccessor.java -> AbstractBindingPropertiesAccessor.java
This commit is contained in:
Ilayaperumal Gopinathan
2015-12-22 22:41:28 +05:30
committed by Mark Fisher
parent 373dd12fbb
commit fa89e5bcb6
22 changed files with 408 additions and 256 deletions

View File

@@ -247,7 +247,7 @@ public abstract class AbstractBinderTests {
@Test
public void testBadDynamic() throws Exception {
Properties properties = new Properties();
properties.setProperty(BinderProperties.PARTITION_KEY_EXPRESSION, "'foo'");
properties.setProperty(BinderPropertyKeys.PARTITION_KEY_EXPRESSION, "'foo'");
Binder<MessageChannel> binder = getBinder();
try {
binder.bindDynamicProducer("queue:foo", properties);

View File

@@ -46,7 +46,7 @@ public abstract class BrokerBinderTests extends
public void testDirectBinding() throws Exception {
Binder binder = getBinder();
Properties properties = new Properties();
properties.setProperty(BinderProperties.DIRECT_BINDING_ALLOWED, "true");
properties.setProperty(BinderPropertyKeys.DIRECT_BINDING_ALLOWED, "true");
DirectChannel moduleInputChannel = new DirectChannel();
moduleInputChannel.setBeanName("direct.input");

View File

@@ -86,8 +86,8 @@ abstract public class PartitionCapableBinderTests extends BrokerBinderTests {
Properties properties = new Properties();
properties.put("partitionKeyExpression", "payload");
properties.put("partitionSelectorExpression", "hashCode()");
properties.put(BinderProperties.NEXT_MODULE_COUNT, "3");
properties.put(BinderProperties.NEXT_MODULE_CONCURRENCY, "2");
properties.put(BinderPropertyKeys.NEXT_MODULE_COUNT, "3");
properties.put(BinderPropertyKeys.NEXT_MODULE_CONCURRENCY, "2");
DirectChannel output = new DirectChannel();
output.setBeanName("test.output");
@@ -187,8 +187,8 @@ abstract public class PartitionCapableBinderTests extends BrokerBinderTests {
Properties properties = new Properties();
properties.put("partitionKeyExtractorClass", "org.springframework.cloud.stream.binder.PartitionTestSupport");
properties.put("partitionSelectorClass", "org.springframework.cloud.stream.binder.PartitionTestSupport");
properties.put(BinderProperties.NEXT_MODULE_COUNT, "3");
properties.put(BinderProperties.NEXT_MODULE_CONCURRENCY, "2");
properties.put(BinderPropertyKeys.NEXT_MODULE_COUNT, "3");
properties.put(BinderPropertyKeys.NEXT_MODULE_CONCURRENCY, "2");
DirectChannel output = new DirectChannel();
output.setBeanName("test.output");