You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@camel.apache.org by GitBox <gi...@apache.org> on 2022/04/27 11:35:01 UTC
[GitHub] [camel] orpiske commented on a diff in pull request #7502: CAMEL-18003: fix incorrect concurrent access to the Kafka consumer
orpiske commented on code in PR #7502:
URL: https://github.com/apache/camel/pull/7502#discussion_r859687232
##########
components/camel-kafka/src/main/java/org/apache/camel/component/kafka/KafkaFetchRecords.java:
##########
@@ -359,6 +369,23 @@ protected void startPolling() {
}
}
+ private void updateTaskState() {
+ switch (state) {
+ case PAUSE_REQUESTED:
+ LOG.info("Pausing the consumer as a response to a pause request");
+ consumer.pause(consumer.assignment());
+ state = State.PAUSED;
+ break;
+ case RESUME_REQUESTED:
+ LOG.info("Resuming the consumer as a response to a resume request");
+ consumer.resume(consumer.assignment());
+ state = State.RUNNING;
+ break;
+ default:
+ break;
+ }
Review Comment:
This is intended, but I think I can do better. I want to be explicit about the state it is.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@camel.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org