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

@@ -96,15 +96,15 @@ public class MessageChannelConfigurerTests {
String inputBindingProps = headerValue.get("input");
assertTrue(inputBindingProps.contains("destination=configure"));
assertTrue(inputBindingProps.contains("trackHistory=true"));
assertTrue(inputBindingProps.contains("concurrency=1"));
assertTrue(headerValue.get("instanceIndex").equals("0"));
assertTrue(headerValue.get("instanceCount").equals("1"));
assertTrue(headerValue.get("producer.nextModuleCount").equals("1"));
assertTrue(headerValue.get("consumer.concurrency").equals("1"));
String outputBindingProps = (String) ((Map<?, ?>) ((List<?>) message.getHeaders()
.get("SPRING_CLOUD_STREAM_HISTORY")).get(0)).get("output");
;
assertTrue(outputBindingProps.contains("destination=configure"));
assertTrue(outputBindingProps.contains("trackHistory=false"));
assertTrue(!outputBindingProps.contains("trackHistory"));
assertTrue(outputBindingProps.contains("nextModuleCount=1"));
latch1.countDown();
}
};

View File

@@ -1,4 +1,4 @@
spring.cloud.stream.bindings.input.destination=configure1
spring.cloud.stream.bindings.input.contentType=application/x-spring-tuple
spring.cloud.stream.bindings.input.trackHistory=true
spring.cloud.stream.consumerProperties.concurrency=1
spring.cloud.stream.bindings.input.concurrency=1

View File

@@ -1,3 +1,3 @@
spring.cloud.stream.bindings.output.destination=configure1
spring.cloud.stream.producerProperties.nextModuleCount=1
spring.cloud.stream.bindings.output.nextModuleCount=1
spring.cloud.stream.bindings.output.contentType=application/json