修改kafka消费

This commit is contained in:
zren25
2025-03-31 13:19:09 +08:00
parent 79acc23dde
commit 54acdc968d

View File

@@ -52,7 +52,7 @@ public class TestController {
public ResultMsg<Object> mockKafka(@RequestBody String message) {
try {
AicorpusTelephoneDTO aicorpusTelephone = objectMapper.readValue(message, AicorpusTelephoneDTO.class);
for (int i = 0; i < 100000; i++){
for (int i = 0; i < 10; i++){
aicorpusTelephone.setSourceId(aicorpusTelephone.getSourceId().concat("_"+i));
kafkaTemplate.send(kafkaTopic, JSONObject.toJSONString(aicorpusTelephone)); // 发送 Kafka 消息
}