This commit is contained in:
Shikong 2024-03-30 17:09:39 +08:00
parent d7da5c5078
commit 3e4f967a51
9 changed files with 54 additions and 7 deletions

6
.idea/jpa-buddy.xml Normal file
View File

@ -0,0 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="JpaBuddyIdeaProjectConfig">
<option name="renamerInitialized" value="true" />
</component>
</project>

View File

@ -12,4 +12,7 @@
<component name="ProjectRootManager" version="2" languageLevel="JDK_1_8" project-jdk-name="1.8" project-jdk-type="JavaSDK">
<output url="file://$PROJECT_DIR$/out" />
</component>
<component name="ProjectType">
<option name="id" value="jpab" />
</component>
</project>

8
.idea/modules.xml Normal file
View File

@ -0,0 +1,8 @@
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="ProjectModuleManager">
<modules>
<module fileurl="file://$PROJECT_DIR$/kafka-01/kafka-01-producer/src/test/python/python.iml" filepath="$PROJECT_DIR$/kafka-01/kafka-01-producer/src/test/python/python.iml" />
</modules>
</component>
</project>

View File

@ -1,6 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="VcsDirectoryMappings">
<mapping directory="$PROJECT_DIR$" vcs="Git" />
<mapping directory="" vcs="Git" />
</component>
</project>

View File

@ -1,8 +1,8 @@
spring:
kafka:
bootstrap-servers: 10.10.10.200:9092
#bootstrap-servers: 10.10.10.200:9192,10.10.10.200:9292,10.10.10.200:9392
# bootstrap-servers: 10.10.10.200:9092
bootstrap-servers: 10.10.10.200:9192,10.10.10.200:9292,10.10.10.200:9392
consumer:
# 自动提交的时间间隔 在spring boot 2.X 版本是值的类型为Duration 需要符合特定的格式如1S,1M,2H,5D

View File

@ -1,7 +1,7 @@
spring:
kafka:
bootstrap-servers: 10.10.10.200:9092
# bootstrap-servers: 10.10.10.200:9192,10.10.10.200:9292,10.10.10.200:9392
# bootstrap-servers: 10.10.10.200:9092
bootstrap-servers: 10.10.10.200:9192,10.10.10.200:9292,10.10.10.200:9392
producer:
retries: 1

View File

@ -1,7 +1,7 @@
spring:
kafka:
bootstrap-servers: 10.10.10.200:9092
# bootstrap-servers: 10.10.10.200:9192,10.10.10.200:9292,10.10.10.200:9392
# bootstrap-servers: 10.10.10.200:9092
bootstrap-servers: 10.10.10.200:9192,10.10.10.200:9292,10.10.10.200:9392
producer:
retries: 1

View File

@ -0,0 +1,21 @@
import os
from concurrent.futures import ThreadPoolExecutor
import requests
server = "http://127.0.0.1:8081/api/v2/"
workers = os.cpu_count()
max_message = 100000
def send(num: int):
print("发送第 %s 条消息" % num)
requests.get(server + str(num))
if __name__ == '__main__':
with ThreadPoolExecutor(max_workers=workers) as worker:
for i in range(max_message):
worker.submit(send, i)

View File

@ -0,0 +1,9 @@
<?xml version="1.0" encoding="UTF-8"?>
<module type="PYTHON_MODULE" version="4">
<component name="NewModuleRootManager" inherit-compiler-output="true">
<exclude-output />
<content url="file://$MODULE_DIR$" />
<orderEntry type="jdk" jdkName="Python 3.10" jdkType="Python SDK" />
<orderEntry type="sourceFolder" forTests="false" />
</component>
</module>