|
|
|
|
@ -37,7 +37,6 @@ import org.springframework.boot.context.properties.ConfigurationProperties;
@@ -37,7 +37,6 @@ import org.springframework.boot.context.properties.ConfigurationProperties;
|
|
|
|
|
import org.springframework.boot.context.properties.PropertyMapper; |
|
|
|
|
import org.springframework.boot.convert.DurationUnit; |
|
|
|
|
import org.springframework.core.io.Resource; |
|
|
|
|
import org.springframework.kafka.core.CleanupConfig; |
|
|
|
|
import org.springframework.kafka.listener.ContainerProperties.AckMode; |
|
|
|
|
import org.springframework.kafka.security.jaas.KafkaJaasLoginModuleInitializer; |
|
|
|
|
import org.springframework.util.CollectionUtils; |
|
|
|
|
@ -686,6 +685,8 @@ public class KafkaProperties {
@@ -686,6 +685,8 @@ public class KafkaProperties {
|
|
|
|
|
|
|
|
|
|
private final Security security = new Security(); |
|
|
|
|
|
|
|
|
|
private final Cleanup cleanup = new Cleanup(); |
|
|
|
|
|
|
|
|
|
/** |
|
|
|
|
* Kafka streams application.id property; default spring.application.name. |
|
|
|
|
*/ |
|
|
|
|
@ -723,11 +724,6 @@ public class KafkaProperties {
@@ -723,11 +724,6 @@ public class KafkaProperties {
|
|
|
|
|
*/ |
|
|
|
|
private String stateDir; |
|
|
|
|
|
|
|
|
|
/** |
|
|
|
|
* Cleanup configuration for the state stores. |
|
|
|
|
*/ |
|
|
|
|
private Cleanup cleanup; |
|
|
|
|
|
|
|
|
|
/** |
|
|
|
|
* Additional Kafka properties used to configure the streams. |
|
|
|
|
*/ |
|
|
|
|
@ -741,6 +737,10 @@ public class KafkaProperties {
@@ -741,6 +737,10 @@ public class KafkaProperties {
|
|
|
|
|
return this.security; |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
public Cleanup getCleanup() { |
|
|
|
|
return this.cleanup; |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
public String getApplicationId() { |
|
|
|
|
return this.applicationId; |
|
|
|
|
} |
|
|
|
|
@ -797,14 +797,6 @@ public class KafkaProperties {
@@ -797,14 +797,6 @@ public class KafkaProperties {
|
|
|
|
|
this.stateDir = stateDir; |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
public Cleanup getCleanup() { |
|
|
|
|
return cleanup; |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
public void setCleanup(Cleanup cleanup) { |
|
|
|
|
this.cleanup = cleanup; |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
public Map<String, String> getProperties() { |
|
|
|
|
return this.properties; |
|
|
|
|
} |
|
|
|
|
@ -1248,53 +1240,57 @@ public class KafkaProperties {
@@ -1248,53 +1240,57 @@ public class KafkaProperties {
|
|
|
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
public enum IsolationLevel { |
|
|
|
|
public static class Cleanup { |
|
|
|
|
|
|
|
|
|
/** |
|
|
|
|
* Read everything including aborted transactions. |
|
|
|
|
* Cleanup the application’s local state directory on startup. |
|
|
|
|
*/ |
|
|
|
|
READ_UNCOMMITTED((byte) 0), |
|
|
|
|
private boolean onStartup = false; |
|
|
|
|
|
|
|
|
|
/** |
|
|
|
|
* Read records from committed transactions, in addition to records not part of |
|
|
|
|
* transactions. |
|
|
|
|
* Cleanup the application’s local state directory on shutdown. |
|
|
|
|
*/ |
|
|
|
|
READ_COMMITTED((byte) 1); |
|
|
|
|
private boolean onShutdown = true; |
|
|
|
|
|
|
|
|
|
private final byte id; |
|
|
|
|
public boolean isOnStartup() { |
|
|
|
|
return this.onStartup; |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
IsolationLevel(byte id) { |
|
|
|
|
this.id = id; |
|
|
|
|
public void setOnStartup(boolean onStartup) { |
|
|
|
|
this.onStartup = onStartup; |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
public byte id() { |
|
|
|
|
return this.id; |
|
|
|
|
public boolean isOnShutdown() { |
|
|
|
|
return this.onShutdown; |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
public void setOnShutdown(boolean onShutdown) { |
|
|
|
|
this.onShutdown = onShutdown; |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
public static class Cleanup { |
|
|
|
|
public enum IsolationLevel { |
|
|
|
|
|
|
|
|
|
/** |
|
|
|
|
* Cleanup the application's state on start. |
|
|
|
|
* Read everything including aborted transactions. |
|
|
|
|
*/ |
|
|
|
|
private boolean onStart = false; |
|
|
|
|
READ_UNCOMMITTED((byte) 0), |
|
|
|
|
|
|
|
|
|
/** |
|
|
|
|
* Cleanup the application's state on stop. |
|
|
|
|
* Read records from committed transactions, in addition to records not part of |
|
|
|
|
* transactions. |
|
|
|
|
*/ |
|
|
|
|
private boolean onStop = true; |
|
|
|
|
READ_COMMITTED((byte) 1); |
|
|
|
|
|
|
|
|
|
public CleanupConfig buildCleanupConfig() { |
|
|
|
|
return new CleanupConfig(this.onStart, this.onStop); |
|
|
|
|
} |
|
|
|
|
private final byte id; |
|
|
|
|
|
|
|
|
|
public boolean isOnStart() { |
|
|
|
|
return onStart; |
|
|
|
|
IsolationLevel(byte id) { |
|
|
|
|
this.id = id; |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
public boolean isOnStop() { |
|
|
|
|
return onStop; |
|
|
|
|
public byte id() { |
|
|
|
|
return this.id; |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
} |
|
|
|
|
|