Spring Cloud Stream supports general configuration options, as well as configuration for bindings and binders. Some binders allow additional properties for the bindings, supporting middleware-specific features.
All configuration options can be provided to Spring Cloud Stream applications via all the mechanisms supported by Spring Boot: application arguments, environment variables, YML files etc.
1
.0
to instanceCount
-1. Used for partitioning and with Kafka. Automatically set in Cloud Foundry to match the instance index of the application.Binding properties are supplied using the format spring.cloud.stream.bindings.<channelName>.<property>=<value>
.<channelName>
represents the name of the channel being configured, e.g. output
for a Source
.
In what follows, we will indicate where the spring.cloud.stream.bindings.<channelName>.
prefix is omitted and focus just on the property name, with the understanding that the prefix will be included at runtime.
The following binding properties are available for both input and output bindings and
must be prefixed with spring.cloud.stream.bindings.<channelName>.
.
null
and no type
coercion is performed. See ???.null
and will
use the default binder, if one exists. See Section 6.2, “Multiple Binders on the Classpath” for details.The following binding properties are available for input bindings only and must be prefixed with spring.cloud.stream.bindings.<channelName>.consumer
:
1
.true
if the consumer is receiving data from a partitioned
producer. By default it is set to false
.1000
.(Ignored by Kafka, currently).10000
.(Ignored by Kafka, currently).2.0
.The following binding properties are available for output bindings only and must be prefixed with spring.cloud.stream.bindings.<channelName>.producer
:
null
. If either this property is set or
partitionKeyExtractorClass
is present, outbound data on this channel will be partitioned,
and partitionCount
must be set to a value larger than 1 to be effective.
The two options are mutually exclusive. See Section 2.3, “Partitioning”.PartitionKeyExtractorStrategy
implementation. Default: null
. If either this property is set or
partitionKeyExpression
is present, outbound data on this channel will be partitioned,
and partitionCount
must be set to a value larger than 1 to be effective.
The two options are mutually exclusive. See Section 2.3, “Partitioning”.PartitionSelectorStrategy
implementation. Default null
. Mutually exclusive with
partitionSelectorExpression
. If none is set, the partition will be selected as the
hashCode(key) % partitionCount
, where key
is computed via either partitionKeyExpression
or partitionKeyExtractorClass
.null
. Mutually exclusive with
partitionSelectorClass
. If none is set, the partition will be selected as the
hashCode(key) % partitionCount
, where key
is computed via either partitionKeyExpression
or partitionKeyExtractorClass
.1
. Must be
set to a value higher than 1
if the producer is partitioned. On Kafka it is interpreted as a
hint, and the larger of this and the partition count of the target topic will be used instead.