title: What is the right way to handle poll interval for spring kafka for a delay queue implementation?
body: <p>I am implementing a sort of delay queue with kafka. Every message which is received by spring kafka listener container for a certain topic (say t1) is meant to be delayed for a certain time (say d minutes) and then msg is to be sent back to another topic (say t2).
  Currently I am doing this in the spring kafka listener container method (AcknowledgingConsumerAwareMessageListener):</p>
  
  <ol>
  <li>receive the msg from t1</li>
  <li>pause the listener container</li>
  <li>sleep for d minutes if required</li>
  <li>resume the listener container</li>
  <li>send the msg to t2</li>
  </ol>
  
  <p>I understand heartbeat thread is a different thread and will not be impacted by the above steps, but the polling happens in the same thread as processing and after the record is processed  <a href="https://stackoverflow.com/questions/50244744/spring-kafka-when-is-exactly-consumer-poll-called-behind-the-hood">as per this answer</a>. I have set my @KafkaListener properties to "max.poll.interval.ms=2xd", so that it doesn't timeout, yet I get NonResponsiveConsumerEvent (with timeSinceLastPoll) from the KafkaEventListener. Even when I don't set max.poll.interval.ms for @KafkaListener properties, I still get the same NonResponsiveConsumerEvent. In both the cases, the message is processed only once and sent to t2.</p>
  
  <p>Questions</p>
  
  <ol>
  <li>If the poll doesn't happen within max.poll.interval.ms when the listener container is paused, what is the consequence of it? What about when the container is not paused? (I have configured consumer to manual ack)</li>
  <li>Should I spawn a separate thread for sleeping and resuming the container and thus free the container processing thread to poll? Does it matter?</li>
  </ol>
  
  <p>versions: Spring Boot 2.1.8, Spring Kafka 2.2.8</p>