chore(性能测试): 修复检查kafka的时候导致的kafka日志异常
This commit is contained in:
parent
364a5b404d
commit
1eb9dd75b2
|
@ -44,7 +44,6 @@ import org.springframework.web.multipart.MultipartFile;
|
||||||
import javax.annotation.Resource;
|
import javax.annotation.Resource;
|
||||||
import java.io.File;
|
import java.io.File;
|
||||||
import java.io.IOException;
|
import java.io.IOException;
|
||||||
import java.io.OutputStream;
|
|
||||||
import java.net.InetSocketAddress;
|
import java.net.InetSocketAddress;
|
||||||
import java.net.Socket;
|
import java.net.Socket;
|
||||||
import java.nio.charset.StandardCharsets;
|
import java.nio.charset.StandardCharsets;
|
||||||
|
@ -315,15 +314,11 @@ public class PerformanceTestService {
|
||||||
//1,建立tcp
|
//1,建立tcp
|
||||||
String ip = ipAndPort[0];
|
String ip = ipAndPort[0];
|
||||||
int port = Integer.parseInt(ipAndPort[1]);
|
int port = Integer.parseInt(ipAndPort[1]);
|
||||||
|
try (
|
||||||
Socket soc = new Socket();
|
Socket soc = new Socket();
|
||||||
|
) {
|
||||||
soc.connect(new InetSocketAddress(ip, port), 1000); // 1s timeout
|
soc.connect(new InetSocketAddress(ip, port), 1000); // 1s timeout
|
||||||
//2.输入内容
|
}
|
||||||
String content = "1010";
|
|
||||||
byte[] bs = content.getBytes();
|
|
||||||
OutputStream os = soc.getOutputStream();
|
|
||||||
os.write(bs);
|
|
||||||
//3.关闭
|
|
||||||
soc.close();
|
|
||||||
}
|
}
|
||||||
} catch (Exception e) {
|
} catch (Exception e) {
|
||||||
LogUtil.error(e.getMessage(), e);
|
LogUtil.error(e.getMessage(), e);
|
||||||
|
|
|
@ -15,7 +15,6 @@ spring.datasource.hikari.connection-test-query=SELECT 1
|
||||||
#kafka
|
#kafka
|
||||||
spring.kafka.bootstrap-servers=${kafka.bootstrap-servers}
|
spring.kafka.bootstrap-servers=${kafka.bootstrap-servers}
|
||||||
spring.kafka.consumer.group-id=metersphere_group_id
|
spring.kafka.consumer.group-id=metersphere_group_id
|
||||||
spring.kafka.producer.properties.security.protocol=PLAINTEXT
|
|
||||||
# mybatis
|
# mybatis
|
||||||
mybatis.configuration.cache-enabled=true
|
mybatis.configuration.cache-enabled=true
|
||||||
mybatis.configuration.lazy-loading-enabled=false
|
mybatis.configuration.lazy-loading-enabled=false
|
||||||
|
|
Loading…
Reference in New Issue