Sync docs from master to gh-pages
This commit is contained in:
@@ -442,7 +442,7 @@ public class TimerSource {
|
||||
private String format;
|
||||
|
||||
@Bean
|
||||
@InboundChannelAdapter(value = Source.OUTPUT, autoStartup = "false", poller = @Poller(fixedDelay = "${fixedDelay}", maxMessagesPerPoll = "1"))
|
||||
@InboundChannelAdapter(value = Source.OUTPUT, poller = @Poller(fixedDelay = "${fixedDelay}", maxMessagesPerPoll = "1"))
|
||||
public MessageSource<String> timerMessageSource() {
|
||||
return () -> new GenericMessage<>(new SimpleDateFormat(format).format(new Date()));
|
||||
}
|
||||
@@ -451,20 +451,6 @@ public class TimerSource {
|
||||
</div>
|
||||
</div>
|
||||
<div class="paragraph">
|
||||
<p>The <code>application.yml</code> has the mapping from channel names to external broker handles (queues, topics, routing keys, etc. depending on the broker), e.g.</p>
|
||||
</div>
|
||||
<div class="listingblock">
|
||||
<div class="title">application.yml</div>
|
||||
<div class="content">
|
||||
<pre>---
|
||||
spring:
|
||||
cloud:
|
||||
stream:
|
||||
bindings:
|
||||
output: ${spring.application.name:ticker}</pre>
|
||||
</div>
|
||||
</div>
|
||||
<div class="paragraph">
|
||||
<p><code>@EnableModule</code> is parameterized by an interface (in this case <code>Source</code>) which declares input and output channels. <code>Source</code>, <code>Sink</code> and <code>Processor</code> are provided off the shelf, but you can define others. Here’s the definition of <code>Source</code></p>
|
||||
</div>
|
||||
<div class="listingblock">
|
||||
@@ -515,7 +501,7 @@ In this case there is only one <code>Source</code> in the application context so
|
||||
<h2 id="_multiple_input_or_output_channels">Multiple Input or Output Channels</h2>
|
||||
<div class="sectionbody">
|
||||
<div class="paragraph">
|
||||
<p>A module can have multiple input or output channels all defined either as <code>@Input</code> and <code>@Output</code> methods in an interface (preferrable) or as bean definitions. Instead of just one channel named "input" or "output" you can add multiple <code>MessageChannel</code> methods annotated <code>@Input</code> or <code>@Output</code> 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 <code>spring.cloud.stream.bindings</code> (e.g. <code>spring.cloud.stream.bindings.input</code> or <code>spring.cloud.stream.bindings.output</code>). External channel names can have 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 <code>MessageChannels</code> called "output" and "foo" in a module with <code>spring.cloud.stream.bindings.output=bar</code> and <code>spring.cloud.stream.bindings.foo=topic:foo</code>, and the result is 2 external channels called "bar" and "topic:foo".</p>
|
||||
<p>A module can have multiple input or output channels all defined either as <code>@Input</code> and <code>@Output</code> methods in an interface (preferrable) or as bean definitions. Instead of just one channel named "input" or "output" you can add multiple <code>MessageChannel</code> methods annotated <code>@Input</code> or <code>@Output</code> 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 <code>spring.cloud.stream.bindings</code> (e.g. <code>spring.cloud.stream.bindings.input</code> or <code>spring.cloud.stream.bindings.output</code>). 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 <code>MessageChannels</code> called "output" and "foo" in a module with <code>spring.cloud.stream.bindings.output=bar</code> and <code>spring.cloud.stream.bindings.foo=topic:foo</code>, and the result is 2 external channels called "bar" and "topic:foo".</p>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
@@ -593,38 +579,10 @@ The main set of samples are "vanilla" in the sense that they are not deployable
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="sect1">
|
||||
<h2 id="_taps">Taps</h2>
|
||||
<div class="sectionbody">
|
||||
<div class="paragraph">
|
||||
<p>All output channels can be also tapped so you can also attach a module to a pub-sub endpoint and listen to the tap if you know the module metadata. To tap an existing vanilla module you need to know its <code>outputChannelName</code> and the tap name is then <code>tap:<outputChannelName></code>, so you can listen to it on an input channel named <code>topic.tap:<outputChannelName></code>. The tap is only active if you explicitly ask for it: you can do that by POSTing to the HTTP endpoint <code>/taps/<channelName></code> (where the channel name can be the internal or external name, e.g. "output" or the external name mapped to the output channel).</p>
|
||||
</div>
|
||||
<div class="paragraph">
|
||||
<p>To tap an existing output channel in an XD module you just need to know its group, name and index, e.g.</p>
|
||||
</div>
|
||||
<div class="listingblock">
|
||||
<div class="content">
|
||||
<pre class="highlight"><code>spring:
|
||||
cloud:
|
||||
stream:
|
||||
group: tocktap
|
||||
name: logger
|
||||
index: 0
|
||||
tap:
|
||||
group: testtock
|
||||
name: ticker
|
||||
index: 0</code></pre>
|
||||
</div>
|
||||
</div>
|
||||
<div class="paragraph">
|
||||
<p>The <code>spring.cloud.stream.tap</code> 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.</p>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div id="footer">
|
||||
<div id="footer-text">
|
||||
Last updated 2015-08-26 09:27:33 UTC
|
||||
Last updated 2015-08-26 18:25:42 UTC
|
||||
</div>
|
||||
</div>
|
||||
</body>
|
||||
|
||||
Reference in New Issue
Block a user