3 lines
4.2 KiB
HTML
3 lines
4.2 KiB
HTML
<html><head>
|
|
<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
|
|
<title>7. Standalone Streaming Applications</title><link rel="stylesheet" type="text/css" href="css/manual-multipage.css"><meta name="generator" content="DocBook XSL Stylesheets V1.78.1"><link rel="home" href="multi_spring-cloud-function.html" title="Spring Cloud Function"><link rel="up" href="multi_spring-cloud-function.html" title="Spring Cloud Function"><link rel="prev" href="multi__standalone_web_applications.html" title="6. Standalone Web Applications"><link rel="next" href="multi__serverless_platform_adapters.html" title="8. Serverless Platform Adapters"></head><body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF"><div class="navheader"><table width="100%" summary="Navigation header"><tr><th colspan="3" align="center">7. Standalone Streaming Applications</th></tr><tr><td width="20%" align="left"><a accesskey="p" href="multi__standalone_web_applications.html">Prev</a> </td><th width="60%" align="center"> </th><td width="20%" align="right"> <a accesskey="n" href="multi__serverless_platform_adapters.html">Next</a></td></tr></table><hr></div><div class="chapter"><div class="titlepage"><div><div><h1 class="title"><a name="_standalone_streaming_applications" href="#_standalone_streaming_applications"></a>7. Standalone Streaming Applications</h1></div></div></div><p>To send or receive messages from a broker (such as RabbitMQ or Kafka) you can use the <code class="literal">spring-cloud-function-stream</code> adapter. Add the adapter to your classpath along with the appropriate binder from Spring Cloud Stream. The adapter will bind to the message broker as a <code class="literal">Processor</code> (input and output streams) unless the user explicitly disables one or the other using <code class="literal">spring.cloud.function.stream.{source,sink}.enabled=false</code>.</p><p>An incoming message is routed to a function (or consumer). If there is only one, then the choice is obvious. If there are multiple functions that can accept an incoming message, the message is inspected to see if there is a <code class="literal">stream_routekey</code> header containing the name of a function. Routing headers or function names can be composed using a comma- or pipe-separated name. The header is also added to outgoing messages from a supplier. Messages with no route key can be routed exclusively to a function or consumer by specifying <code class="literal">spring.cloud.function.stream.{processor,sink}.name</code>. If a single function cannot be identified to process an incoming message there will be an error, unless you set <code class="literal">spring.cloud.function.stream.shared=true</code>, in which case such messages will be sent to all compatible functions. A single supplier can be chosen for output messages from a supplier (if more than one is available) using the <code class="literal">spring.cloud.function.stream.source.name</code>.</p><div class="note" style="margin-left: 0.5in; margin-right: 0.5in;"><table border="0" summary="Note"><tr><td rowspan="2" align="center" valign="top" width="25"><img alt="[Note]" src="images/note.png"></td><th align="left">Note</th></tr><tr><td align="left" valign="top"><p>some binders will fail on startup if the message broker is not available and the function catalog contains suppliers that immediately produce messages when accessed. You can switch off the automatic publishing from suppliers on startup using the <code class="literal">spring.cloud.function.strean.supplier.enabled=false</code> flag.</p></td></tr></table></div></div><div class="navfooter"><hr><table width="100%" summary="Navigation footer"><tr><td width="40%" align="left"><a accesskey="p" href="multi__standalone_web_applications.html">Prev</a> </td><td width="20%" align="center"> </td><td width="40%" align="right"> <a accesskey="n" href="multi__serverless_platform_adapters.html">Next</a></td></tr><tr><td width="40%" align="left" valign="top">6. Standalone Web Applications </td><td width="20%" align="center"><a accesskey="h" href="multi_spring-cloud-function.html">Home</a></td><td width="40%" align="right" valign="top"> 8. Serverless Platform Adapters</td></tr></table></div></body></html> |