Spring Kafka不会再次轮询,即使在循环内没有执行commit

Spring Kafka不会再次轮询,即使在循环内没有执行commit,spring,apache-kafka,Spring,Apache Kafka,在调试模式下启动应用程序时,我的应用程序在以下代码中运行良好,但在运行应用程序时,它从未进入循环。即使当前时间戳大于ts2,它也不会进入循环 @KafkaListener( id ="consumerContainer", topics = "topic1", groupId = "Consumer_Test", containerFactory = "kafkaListenerContainerFactory")

在调试模式下启动应用程序时,我的应用程序在以下代码中运行良好,但在运行应用程序时,它从未进入循环。即使当前时间戳大于ts2,它也不会进入循环

@KafkaListener( id ="consumerContainer", topics = "topic1", groupId = "Consumer_Test", containerFactory = "kafkaListenerContainerFactory")
    public void consume(ConsumerRecord<String, String> record, Acknowledgment acknowledgment) throws Exception {

           Long ts1 = record.timestamp();
           Long ts2 = ts1 + TimeUnit.MINUTES.toMillis(5);
           Long currentDateTime = System.currentTimeMillis();
           int b3 = currentDateTime.compareTo(ts2);
           
              if (b3 > 0) {
               this.recordPublisher.publish(record.value());
               acknowledgment.acknowledge();
               System.out.println("record received is "+record.key());
           }
    }

调试模式是什么意思?你会暂停执行吗?根据暂停执行的位置,这可能会修改currentDateTime的值,以便b3确实大于0。您可以在此处显示您的使用者配置。这是config config.put(ConsumerConfig.BOOTSTRAP\u SERVERS\u config,broker);config.put(ConsumerConfig.KEY_反序列化程序_CLASS_config,StringDeserializer.CLASS.getName());config.put(ConsumerConfig.VALUE\u反序列化程序\u CLASS\u config,StringDeserializer.CLASS.getName());config.put(ConsumerConfig.ENABLE_AUTO_COMMIT_config,“false”);config.put(ConsumerConfig.MAX\u POLL\u RECORDS\u config,1);config.put(ConsumerConfig.MAX_POLL_INTERVAL_MS_config,“300000”);调试模式是什么意思?你会暂停执行吗?根据暂停执行的位置,这可能会修改currentDateTime的值,以便b3确实大于0。您可以在此处显示您的使用者配置。这是config config.put(ConsumerConfig.BOOTSTRAP\u SERVERS\u config,broker);config.put(ConsumerConfig.KEY_反序列化程序_CLASS_config,StringDeserializer.CLASS.getName());config.put(ConsumerConfig.VALUE\u反序列化程序\u CLASS\u config,StringDeserializer.CLASS.getName());config.put(ConsumerConfig.ENABLE_AUTO_COMMIT_config,“false”);config.put(ConsumerConfig.MAX\u POLL\u RECORDS\u config,1);config.put(ConsumerConfig.MAX_POLL_INTERVAL_MS_config,“300000”);
factory.getContainerProperties().setAckMode(ContainerProperties.AckMode.MANUAL_IMMEDIATE);
factory.getContainerProperties().setSyncCommits(true);