I am new to Kafka and I have a Kafka consumer implemented using Java Apache Camel library. The issue I found out is - Consumer takes a long time(>15 mins) to process for few messages- which is fine for our use case.
Need some config help because the same message is re-sent after 15 mins if not processed within 15 mins(thread control does not return I believe). I think this might be the default interval, not sure which property is this.
So, where can I have to fix the config
- Producer level, so that it does not resend
- Or Producer is not involved in re-sending, it's the Broker - Kafka server so Consumer must acknowledge the message - in my case just before processing.
My producer has these properties:
<entry key="bootstrap.servers" value="${kafka.bootstrap.servers}" />
<entry key="key.serializer" value="org.apache.kafka.common.serialization.StringSerializer" />
<entry key="value.serializer" value="org.apache.kafka.common.serialization.StringSerializer" />
My consumer configs look like
<endpoint id="apolloKafkaJanitorEventListenerURI"
uri="kafka:${kafka.bootstrap.servers}?topic=${apollo.janitor.event.topic}&
groupId=${apollo.janitor.event.group.id}&
consumersCount=${apollo.janitor.event.consumer.count}&
consumerRequestTimeoutMs=${eventConsumerRequestTimeoutMs}&
sessionTimeoutMs=${eventConsumerSessionTimeoutMs}&
maxPartitionFetchBytes=${eventConsumerMaxPartitionFetchBytes}" />
I have googled didn't find any relevant issues. Found "acks=0" property on Producer and for Consumer the following. Have not tested but want to see if I am on right track first
KafkaManualCommit manual =
exchange.getIn().getHeader(KafkaConstants.MANUAL_COMMIT, KafkaManualCommit.class);
manual.commitSync();