This commit is contained in:
Ilayaperumal Gopinathan
2015-12-21 13:25:21 +05:30
parent 7ee5df4033
commit 7550a89a25

View File

@@ -7,7 +7,6 @@ Here's a sample source module (output channel only):
[source,java]
----
@SpringBootApplication
@ComponentScan(basePackageClasses=TimerSource.class)
public class ModuleApplication {
public static void main(String[] args) {
@@ -16,7 +15,6 @@ public class ModuleApplication {
}
@Configuration
@EnableBinding(Source.class)
public class TimerSource {
@@ -53,7 +51,7 @@ The `@Output` annotation is used to identify output channels (messages leaving t
public class ModuleApplicationTests {
@Autowired
private Source source
private Source source;
@Test
public void contextLoads() {
@@ -67,7 +65,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 can be specified as properties that consist of the channel names prefixed with `spring.cloud.stream.bindings` (e.g. `spring.cloud.stream.bindings.input` or `spring.cloud.stream.bindings.output`). External channel names can have a channel type as a colon-separated prefix, and the semantics of the external bus channel changes accordingly. For example, you can have two `MessageChannels` called "output" and "foo" in a module with `spring.cloud.stream.bindings.output=bar` and `spring.cloud.stream.bindings.foo=topic:foo`, and the result is 2 external channels called "bar" and "topic:foo".
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 can be specified as properties that consist of the channel names prefixed with `spring.cloud.stream.bindings` (e.g. `spring.cloud.stream.bindings.input.destination` or `spring.cloud.stream.bindings.output.destination`). External channel names can have a channel type as a colon-separated prefix, and the semantics of the external bus channel changes accordingly. For example, you can have two `MessageChannels` called "output" and "foo" in a module with `spring.cloud.stream.bindings.output.destination=bar` and `spring.cloud.stream.bindings.foo.destination=topic:foo`, and the result is 2 external channels called "bar" and "topic:foo".
== Samples
@@ -90,7 +88,7 @@ If you run the source and the sink and point them at the same redis instance (e.
== Module or App
Code using this library can be deployed as a standalone app or as an XD module. In standalone mode you app will run happily as a service or in any PaaS (Cloud Foundry, Lattice, Heroku, Azure, etc.). Depending on whether your main aim is to develop an XD module and you just want to test it locally using the standalone mode, or if the ultimate goal is a standalone app, there are some things that you might do differently.
Code using this library can be deployed as a standalone app or as an XD module. In standalone mode your app will run happily as a service or in any PaaS (Cloud Foundry, Lattice, Heroku, Azure, etc.). Depending on whether your main aim is to develop an XD module and you just want to test it locally using the standalone mode, or if the ultimate goal is a standalone app, there are some things that you might do differently.
=== Fat JAR
@@ -104,7 +102,7 @@ The `[input,output]ChannelName` are used to create physical endpoints in the ext
For an XD module the channel names are `<group>.<index>` and a source (output only) has `index=0` (the default) and downstream modules have the same group but incremented index, with a sink module (input only) having the highest index. To listen to the output from a running XD module, just use the same "group" name and an index 1 larger than the app before it in the chain.
> Note: since the same naming conventions are used in XD, you can steal messages from or send messages to an existing XD stream by copying the stream name (to `spring.cloud.streams.group`) and knowing the index of the XD module you want to interact with.
> Note: since the same naming conventions are used in XD, you can steal messages from or send messages to an existing XD stream by copying the stream name (to `spring.cloud.stream.<channelName>.group`) and knowing the index of the XD module you want to interact with.
=== Contributing
@@ -114,4 +112,4 @@ We love contributions. Follow this https://github.com/spring-cloud/spring-cloud
// Building
//
// TODO point to ref doc section
// TODO point to ref doc section