Support allowNonTransactional config
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
This commit is contained in:
committed by
Gary Russell
parent
5a7cc9f257
commit
a1b31e67c4
@@ -105,6 +105,11 @@ public class KafkaProducerProperties {
|
||||
*/
|
||||
private int closeTimeout;
|
||||
|
||||
/**
|
||||
* Set to true to disable transactions.
|
||||
*/
|
||||
private boolean allowNonTransactional;
|
||||
|
||||
/**
|
||||
* @return buffer size
|
||||
*
|
||||
@@ -279,6 +284,14 @@ public class KafkaProducerProperties {
|
||||
this.closeTimeout = closeTimeout;
|
||||
}
|
||||
|
||||
public boolean isAllowNonTransactional() {
|
||||
return this.allowNonTransactional;
|
||||
}
|
||||
|
||||
public void setAllowNonTransactional(boolean allowNonTransactional) {
|
||||
this.allowNonTransactional = allowNonTransactional;
|
||||
}
|
||||
|
||||
/**
|
||||
* Enumeration for compression types.
|
||||
*/
|
||||
|
||||
Reference in New Issue
Block a user