* GH-1140: CommonErrorHandler per consumer binding
Setting CommonErrorHandler on consumer binding through its bean name.
If present, binder will resolve this bean and assign it on the listener
container.
Resolves https://github.com/spring-cloud/spring-cloud-stream-binder-kafka/issues/1140
* Addressing PR review
Add a new producer extended property for allowNonTransactional.
When set to true, records published to this output binding will
not be run in a transaction, unless one is already in process.
By default, all ouput bindings associated with a transactional
binder publishes in a new transaction. This new property can be
used to override this behavior.
Addressing PR review comments.
Resolves https://github.com/spring-cloud/spring-cloud-stream-binder-kafka/issues/990
Altering existing topic configurations based on a new binder property.
Existing topic configurations are only modified if `autoAlterTopics` is
enabled. By default, this is disabled.
Adding tests to verify.
Docs.
Logging level changes.
Checkstyle fixes
* Copy cert files from classpath to file-system
If `ssl.truststore.location` and `ssl.keystore.location` are
provided as classpath resources, convert them to absolute paths
on the filesystem. This is because of a restriction in the Kafka client
in which it does not allow certificates to be read from the classpath.
See these issues for more details:
https://issues.apache.org/jira/browse/KAFKA-7685https://cwiki.apache.org/confluence/display/KAFKA/KIP-398%3A+Support+reading+trust+store+from+classpath
This commit allows the Spring Cloud Stream application to provide the
cert files as classpath: reosources, but the binder internally move
them to a locations on the local filesystem and then use that absolute
path as the value for cert locations. Adding properties for optional paths
to move the files to. If no values are provided for these properties,
then use the system's /tmp directory.
Adding tests and docs.
Resolves https://github.com/spring-cloud/spring-cloud-stream-binder-kafka/issues/985
* Addressing PR review comments
* Addressing further PR review comments
* Consolidate keystore/truststore filesystem locations into a single property
* Addressing PR review
* Custom DLQ Destination Resolver
Allow applications to provide a custom DLQ destination resolver
implementaiton by providing a new interface DlqDestinationResolver
as part of binder's public contract. This interface is a BiFunction
extension using which the applications can provide more fine grained
control over where to route records in error.
Adding test to verify.
Adding docs.
Resolves https://github.com/spring-cloud/spring-cloud-stream-binder-kafka/issues/966
* Add DlqDestinationResolver to MessageChannel based binder.
Tests and docs
If both boot and binder level config for bootstrap servers are present, the boot
one always wins currently regardless of any binder settings, unless the boot one
evaluates to the default (localhost:9092). This is especially a problem in a
multi binder scenario. Addressing this issue by simplifying the evaluation and
always gives the binder config the highest precedence.
Resolves https://github.com/spring-cloud/spring-cloud-stream-binder-kafka/issues/967
* Deprecate autoCommitOffset in favor or ackMode
Deprecate autoCommitOffset in favor of using a newly introduced consumer property ackMode.
If the consumer is not in batch mode and if ackEachRecord is enabled, then container
will use RECORD ackMode. Otherwise, use the provided ackMode using this property.
If none of these are true, then it will defer to the default setting of BATCH ackMode
set by the container.
Resolves https://github.com/spring-cloud/spring-cloud-stream-binder-kafka/issues/877
* Address PR review comments
* Addressing PR review comments
* Fix health indicator to properly indicate partition failure
* Add new flag to control binder health indicator behavior
* Regardless of the consumer that is reading from a partition, if the binder
detects that a partition for the topic is without a leader, mark the binder
health as DOWN (if the flag is set to true).
* Remove synchronize block since only one thread executes the block
* Add Docs for the new binder flag
* Fix checkstyle issues
* Change default replication factor to -1
Binder now uses a default value of -1 for replication factor signaling the
broker to use defaults. Users who are on Kafka brokers older than 2.4,
need to set this to the previous default value of 1 used in the binder.
In either case, if there is an admin policy that requires replication factor > 1,
then that value must be used instead.
Resolves https://github.com/spring-cloud/spring-cloud-stream-binder-kafka/issues/808
* Addressing PR review comments
Use a retry template for topic description method call through
admin client when provisioning producer destinations. We are
retrying because in the event this operation gets failed, it
is retried with the default retry settings in the provisioner.
Resolves https://github.com/spring-cloud/spring-cloud-stream-binder-kafka/issues/888