Support consumption from multiple non-native part.

Currently, non-native partitioning (e.g. RabbitMQ) require
an instance per partition.
Add support to allow one instance to consume from multiple
partitions.

Changed instanceIndex from single valued to List

Added a new property to support index list to spawn multiple consumers

added test for the index list usage

added author to the changed files. Fixes-gh-1232

Using object utils to check if a list is empty

Only look at indexes when partitioned

Add docs for `instanceIndexList`
This commit is contained in:
Michailidis Michael
2019-10-30 11:04:19 +02:00
committed by Gary Russell
parent fa40b7f476
commit 8838d9227e
5 changed files with 143 additions and 13 deletions

View File

@@ -1887,18 +1887,23 @@ defaultRetryable::
Whether exceptions thrown by the listener that are not listed in the `retryableExceptions` are retryable.
+
Default: `true`.
instanceIndex::
When set to a value greater than equal to zero, it allows customizing the instance index of this consumer (if different from `spring.cloud.stream.instanceIndex`).
When set to a negative value, it defaults to `spring.cloud.stream.instanceIndex`.
See `<<spring-cloud-stream-overview-instance-index-instance-count>>` for more information.
+
Default: `-1`.
instanceCount::
When set to a value greater than equal to zero, it allows customizing the instance count of this consumer (if different from `spring.cloud.stream.instanceCount`).
When set to a negative value, it defaults to `spring.cloud.stream.instanceCount`.
See `<<spring-cloud-stream-overview-instance-index-instance-count>>` for more information.
+
Default: `-1`.
instanceIndex::
When set to a value greater than equal to zero, it allows customizing the instance index of this consumer (if different from `spring.cloud.stream.instanceIndex`).
When set to a negative value, it defaults to `spring.cloud.stream.instanceIndex`.
Ignored if `instanceIndexList` is provided.
See `<<spring-cloud-stream-overview-instance-index-instance-count>>` for more information.
+
Default: `-1`.
instanceIndexList::
Used with binders that do not support native partitioning (such as RabbitMQ); allows an application instance to consume from more than one partition.
+
Default: `-1`.
retryableExceptions::
A map of Throwable class names in the key and a boolean in the value.
Specify those exceptions (and subclasses) that will or won't be retried.