diff --git a/src/main/java/com/example/zxweb/utils/KafkaUtil.java b/src/main/java/com/example/zxweb/utils/KafkaUtil.java index fa56575..804104a 100644 --- a/src/main/java/com/example/zxweb/utils/KafkaUtil.java +++ b/src/main/java/com/example/zxweb/utils/KafkaUtil.java @@ -14,9 +14,7 @@ import java.util.Properties; */ @Component public class KafkaUtil { - //public static String trustestore="/opt/kafka/client.trustestore.p12"; - - public static String trustestore="E:\\szxy\\client.trustestore.p12"; + public static String trustestore="/opt/kafka/client.trustestore.p12"; @Value("${appCode}") public String appCode; @@ -67,11 +65,14 @@ public class KafkaUtil { }else{ properties.setProperty("bootstrap.servers", "10.0.10.153:29551,10.0.10.153:29552"); } + properties.setProperty("enable.auto.commit", "true"); properties.setProperty("auto.commit.interval.ms", "1000"); + properties.setProperty("session.timeout.ms", "30000"); properties.setProperty("session.timeout.ms", "5000"); properties.setProperty("auto.offset.reset", "earliest"); properties.setProperty("ssl.endpoint.identification.algorithm", ""); return properties; } } + diff --git a/src/main/resources/application-dev.yml b/src/main/resources/application-dev.yml index a8c5569..eba5c87 100644 --- a/src/main/resources/application-dev.yml +++ b/src/main/resources/application-dev.yml @@ -4,23 +4,6 @@ knife4j: enable: true spring: - kafka: - #??????? - topic: sourcetopic - producer: - bootstrap-servers: 10.0.10.153:29551,10.0.10.153:29552,10.0.10.153:29553,10.0.10.153:29554 - key-serializer: org.apache.kafka.common.serialization.StringSerializer - value-serializer: org.apache.kafka.common.serialization.StringSerializer - retries: 3 - properties: - retry.backoff.ms: 100 #?????????100 - linger.ms: 0 #???0???????????????????batch??? - max.request.size: 1048576 #??1MB?????????? - connections.max.idle.ms: 540000 #??9??????????????? - receive.buffer.bytes: 32768 #??32KB???socket????????????-1?????????? - send.buffer.bytes: 131072 #??128KB???socket???????????-1?????????? - request.timeout.ms: 10000 #??30000ms?????????????? - transaction.timeout.ms: 5000 # thymeleaf 页面配置 thymeleaf: cache: false diff --git a/src/main/resources/application-test.yml b/src/main/resources/application-test.yml index 9b33a1f..d65a881 100644 --- a/src/main/resources/application-test.yml +++ b/src/main/resources/application-test.yml @@ -4,23 +4,6 @@ knife4j: enable: true spring: - kafka: - #??????? - topic: sourcetopic - producer: - bootstrap-servers: 10.0.10.153:29551,10.0.10.153:29552,10.0.10.153:29553,10.0.10.153:29554 - key-serializer: org.apache.kafka.common.serialization.StringSerializer - value-serializer: org.apache.kafka.common.serialization.StringSerializer - retries: 3 - properties: - retry.backoff.ms: 100 #?????????100 - linger.ms: 0 #???0???????????????????batch??? - max.request.size: 1048576 #??1MB?????????? - connections.max.idle.ms: 540000 #??9??????????????? - receive.buffer.bytes: 32768 #??32KB???socket????????????-1?????????? - send.buffer.bytes: 131072 #??128KB???socket???????????-1?????????? - request.timeout.ms: 10000 #??30000ms?????????????? - transaction.timeout.ms: 5000 # thymeleaf 页面配置 thymeleaf: cache: false