From 1a51c32f59e68e0a70d88f1fe362588076ce7131 Mon Sep 17 00:00:00 2001 From: Marius Bogoevici Date: Tue, 21 Jul 2015 21:50:26 -0400 Subject: [PATCH] Renamed spring.cloud.channels to spring.cloud.stream in configuration --- README.adoc | 8 ++++---- docs/src/main/asciidoc/intro.adoc | 8 ++++---- roadmap.md | 2 +- .../double/src/main/resources/sink.yml | 2 +- .../double/src/main/resources/source.yml | 2 +- .../sink/src/main/resources/application.yml | 2 +- .../source/src/main/resources/application.yml | 4 ++-- .../tap/src/main/resources/bootstrap.yml | 2 +- .../transform/src/main/resources/application.yml | 2 +- .../cloud/stream/aggregate/AggregateBuilder.java | 4 ++-- .../cloud/stream/config/ChannelBindingProperties.java | 2 +- .../config/ChannelBindingPropertiesAutoConfiguration.java | 2 +- 12 files changed, 20 insertions(+), 20 deletions(-) diff --git a/README.adoc b/README.adoc index e52828529..148895b04 100644 --- a/README.adoc +++ b/README.adoc @@ -41,7 +41,7 @@ The `application.yml` has the mapping from channel names to external broker hand --- spring: cloud: - channels: + stream: outputChannelName: ${spring.application.name:ticker} ---- @@ -80,7 +80,7 @@ NOTE: In this case there is only one `Source` in the application context so ther == Multiple Input or Output Channels -A module can have multiple input or output channels all defined either as `@Input` and `@Output` methods in an interface (preferrable) or as bean definitions. Instead of just one channel named "input" or "output" you can add multiple `MessageChannel` methods annotated `input.*` or `output.*` and the names are converted to external channel names on the broker. The external channel names are the `spring.cloud.channels.[input|output]ChannelName` plus the `MessageChannel` bean name, period separated. In addition, the bean name can be `input.[queue|topic|tap]:*` or `output.[queue|topic]:*` (i.e. with a channel type as a colon-separated prefix), and the semantics of the external bus channel changes accordingly (a tap is like a topic). For example, you can have two `MessageChannels` called "output" and "output.topic:foo" in a module with `outputChannelName=bar`, and the result is 2 external channels called "bar" and "topic:foo.bar". +A module can have multiple input or output channels all defined either as `@Input` and `@Output` methods in an interface (preferrable) or as bean definitions. Instead of just one channel named "input" or "output" you can add multiple `MessageChannel` methods annotated `input.*` or `output.*` and the names are converted to external channel names on the broker. The external channel names are the `spring.cloud.stream.[input|output]ChannelName` plus the `MessageChannel` bean name, period separated. In addition, the bean name can be `input.[queue|topic|tap]:*` or `output.[queue|topic]:*` (i.e. with a channel type as a colon-separated prefix), and the semantics of the external bus channel changes accordingly (a tap is like a topic). For example, you can have two `MessageChannels` called "output" and "output.topic:foo" in a module with `outputChannelName=bar`, and the result is 2 external channels called "bar" and "topic:foo.bar". == Samples @@ -128,7 +128,7 @@ To tap an existing output channel in an XD module you just need to know its grou ``` spring: cloud: - channels: + stream: group: tocktap name: logger index: 0 @@ -138,7 +138,7 @@ spring: index: 0 ``` -The `spring.cloud.channels.tap` section tells the module runner which topic you want to subscribe to. It creates a new group (a tap can't be in the same group as the one it is tapping) and starts a new index count, in case anyone wants to listen downstream. +The `spring.cloud.stream.tap` section tells the module runner which topic you want to subscribe to. It creates a new group (a tap can't be in the same group as the one it is tapping) and starts a new index count, in case anyone wants to listen downstream. == Building diff --git a/docs/src/main/asciidoc/intro.adoc b/docs/src/main/asciidoc/intro.adoc index 75740eafc..09c48e01f 100644 --- a/docs/src/main/asciidoc/intro.adoc +++ b/docs/src/main/asciidoc/intro.adoc @@ -37,7 +37,7 @@ The `application.yml` has the mapping from channel names to external broker hand --- spring: cloud: - channels: + stream: outputChannelName: ${spring.application.name:ticker} ---- @@ -76,7 +76,7 @@ NOTE: In this case there is only one `Source` in the application context so ther == Multiple Input or Output Channels -A module can have multiple input or output channels all defined either as `@Input` and `@Output` methods in an interface (preferrable) or as bean definitions. Instead of just one channel named "input" or "output" you can add multiple `MessageChannel` methods annotated `input.*` or `output.*` and the names are converted to external channel names on the broker. The external channel names are the `spring.cloud.channels.[input|output]ChannelName` plus the `MessageChannel` bean name, period separated. In addition, the bean name can be `input.[queue|topic|tap]:*` or `output.[queue|topic]:*` (i.e. with a channel type as a colon-separated prefix), and the semantics of the external bus channel changes accordingly (a tap is like a topic). For example, you can have two `MessageChannels` called "output" and "output.topic:foo" in a module with `outputChannelName=bar`, and the result is 2 external channels called "bar" and "topic:foo.bar". +A module can have multiple input or output channels all defined either as `@Input` and `@Output` methods in an interface (preferrable) or as bean definitions. Instead of just one channel named "input" or "output" you can add multiple `MessageChannel` methods annotated `input.*` or `output.*` and the names are converted to external channel names on the broker. The external channel names are the `spring.cloud.stream.[input|output]ChannelName` plus the `MessageChannel` bean name, period separated. In addition, the bean name can be `input.[queue|topic|tap]:*` or `output.[queue|topic]:*` (i.e. with a channel type as a colon-separated prefix), and the semantics of the external bus channel changes accordingly (a tap is like a topic). For example, you can have two `MessageChannels` called "output" and "output.topic:foo" in a module with `outputChannelName=bar`, and the result is 2 external channels called "bar" and "topic:foo.bar". == Samples @@ -124,7 +124,7 @@ To tap an existing output channel in an XD module you just need to know its grou ``` spring: cloud: - channels: + stream: group: tocktap name: logger index: 0 @@ -134,5 +134,5 @@ spring: index: 0 ``` -The `spring.cloud.channels.tap` section tells the module runner which topic you want to subscribe to. It creates a new group (a tap can't be in the same group as the one it is tapping) and starts a new index count, in case anyone wants to listen downstream. +The `spring.cloud.stream.tap` section tells the module runner which topic you want to subscribe to. It creates a new group (a tap can't be in the same group as the one it is tapping) and starts a new index count, in case anyone wants to listen downstream. diff --git a/roadmap.md b/roadmap.md index 0713f5179..c00e290af 100644 --- a/roadmap.md +++ b/roadmap.md @@ -48,7 +48,7 @@ The `application.yml` has the external channel names, e.g. --- spring: cloud: - channels: + stream: outputChannelName: ${spring.application.name:ticker} ``` diff --git a/spring-cloud-stream-samples/double/src/main/resources/sink.yml b/spring-cloud-stream-samples/double/src/main/resources/sink.yml index 508af83e3..4bd18d4c0 100644 --- a/spring-cloud-stream-samples/double/src/main/resources/sink.yml +++ b/spring-cloud-stream-samples/double/src/main/resources/sink.yml @@ -1,5 +1,5 @@ spring: cloud: - channels: + stream: inputChannelName: testtock \ No newline at end of file diff --git a/spring-cloud-stream-samples/double/src/main/resources/source.yml b/spring-cloud-stream-samples/double/src/main/resources/source.yml index 8d7308b20..fc77f957d 100644 --- a/spring-cloud-stream-samples/double/src/main/resources/source.yml +++ b/spring-cloud-stream-samples/double/src/main/resources/source.yml @@ -1,6 +1,6 @@ fixedDelay: 5000 spring: cloud: - channels: + stream: outputChannelName: testtock \ No newline at end of file diff --git a/spring-cloud-stream-samples/sink/src/main/resources/application.yml b/spring-cloud-stream-samples/sink/src/main/resources/application.yml index 940f92d5f..8ef7e4dc3 100644 --- a/spring-cloud-stream-samples/sink/src/main/resources/application.yml +++ b/spring-cloud-stream-samples/sink/src/main/resources/application.yml @@ -2,7 +2,7 @@ server: port: 8081 spring: cloud: - channels: + stream: inputChannelName: testtock # uncomment below to have this module consume from a specific partition # in the range of 0 to N-1, where N is the upstream module's partitionCount diff --git a/spring-cloud-stream-samples/source/src/main/resources/application.yml b/spring-cloud-stream-samples/source/src/main/resources/application.yml index 342e7cde2..3f05363f3 100644 --- a/spring-cloud-stream-samples/source/src/main/resources/application.yml +++ b/spring-cloud-stream-samples/source/src/main/resources/application.yml @@ -3,7 +3,7 @@ server: fixedDelay: 5000 spring: cloud: - channels: + stream: outputChannelName: testtock # uncomment below to use the last digit of the seconds as a partition key # hashcode(key) % N is then applied with N being the partitionCount value @@ -16,5 +16,5 @@ spring: spring: profiles: extended cloud: - channels: + stream: outputChannelName: xformed diff --git a/spring-cloud-stream-samples/tap/src/main/resources/bootstrap.yml b/spring-cloud-stream-samples/tap/src/main/resources/bootstrap.yml index dd020503d..6f833e659 100644 --- a/spring-cloud-stream-samples/tap/src/main/resources/bootstrap.yml +++ b/spring-cloud-stream-samples/tap/src/main/resources/bootstrap.yml @@ -1,7 +1,7 @@ --- spring: cloud: - channels: + stream: group: tocktap name: logger index: 0 diff --git a/spring-cloud-stream-samples/transform/src/main/resources/application.yml b/spring-cloud-stream-samples/transform/src/main/resources/application.yml index edbdf3181..bc0a8fabc 100644 --- a/spring-cloud-stream-samples/transform/src/main/resources/application.yml +++ b/spring-cloud-stream-samples/transform/src/main/resources/application.yml @@ -2,7 +2,7 @@ server: port: 8082 spring: cloud: - channels: + stream: outputChannelName: xformed inputChannelName: testtock \ No newline at end of file diff --git a/spring-cloud-stream/src/main/java/org/springframework/cloud/stream/aggregate/AggregateBuilder.java b/spring-cloud-stream/src/main/java/org/springframework/cloud/stream/aggregate/AggregateBuilder.java index 15de0f3a2..3ff2ee675 100644 --- a/spring-cloud-stream/src/main/java/org/springframework/cloud/stream/aggregate/AggregateBuilder.java +++ b/spring-cloud-stream/src/main/java/org/springframework/cloud/stream/aggregate/AggregateBuilder.java @@ -230,10 +230,10 @@ public class AggregateBuilder implements ApplicationContextAware { args.add("--spring.config.name=" + this.configName); } if (this.input != null) { - args.add("--spring.cloud.channels.inputChannelName=" + this.input); + args.add("--spring.cloud.stream.inputChannelName=" + this.input); } if (this.output != null) { - args.add("--spring.cloud.channels.outputChannelName=" + this.output); + args.add("--spring.cloud.stream.outputChannelName=" + this.output); } this.builder.run(args.toArray(new String[0])); } diff --git a/spring-cloud-stream/src/main/java/org/springframework/cloud/stream/config/ChannelBindingProperties.java b/spring-cloud-stream/src/main/java/org/springframework/cloud/stream/config/ChannelBindingProperties.java index c53321c80..e3e54aea4 100644 --- a/spring-cloud-stream/src/main/java/org/springframework/cloud/stream/config/ChannelBindingProperties.java +++ b/spring-cloud-stream/src/main/java/org/springframework/cloud/stream/config/ChannelBindingProperties.java @@ -27,7 +27,7 @@ import com.fasterxml.jackson.annotation.JsonInclude.Include; * @author Dave Syer * */ -@ConfigurationProperties("spring.cloud.channels") +@ConfigurationProperties("spring.cloud.stream") @JsonInclude(Include.NON_DEFAULT) public class ChannelBindingProperties { diff --git a/spring-cloud-stream/src/main/java/org/springframework/cloud/stream/config/ChannelBindingPropertiesAutoConfiguration.java b/spring-cloud-stream/src/main/java/org/springframework/cloud/stream/config/ChannelBindingPropertiesAutoConfiguration.java index 46ee4ae57..ebb477018 100644 --- a/spring-cloud-stream/src/main/java/org/springframework/cloud/stream/config/ChannelBindingPropertiesAutoConfiguration.java +++ b/spring-cloud-stream/src/main/java/org/springframework/cloud/stream/config/ChannelBindingPropertiesAutoConfiguration.java @@ -29,7 +29,7 @@ import org.springframework.context.annotation.Configuration; @ConditionalOnMissingBean(value = ChannelBindingProperties.class, search = SearchStrategy.CURRENT) public class ChannelBindingPropertiesAutoConfiguration { - @Bean(name = "spring.cloud.channels.CONFIGURATION_PROPERTIES") + @Bean(name = "spring.cloud.stream.CONFIGURATION_PROPERTIES") public ChannelBindingProperties moduleProperties() { return new ChannelBindingProperties(); }