# Delay in message consumption from Kafka Topic

**URL:** <https://forum.confluent.io/t/delay-in-message-consumption-from-kafka-topic/11322>\
**Category:** Clients\
**Created:** [27 August 2024 15:40 UTC](https://forum.confluent.io/t/delay-in-message-consumption-from-kafka-topic/11322 "2024-08-27T15:40:29Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![ziabaaz01](https://avatars.discourse-cdn.com/v4/letter/z/848f3c/32.png) [@ziabaaz01](https://forum.confluent.io/u/ziabaaz01)\
**Post date:** [27 August 2024 15:40 UTC](https://forum.confluent.io/t/delay-in-message-consumption-from-kafka-topic/11322/1 "2024-08-27T15:40:29Z")

</div>

I have a set of Kafka consumer which are subscribed to a Kafka topic with 16 partitions. Consumers run a long processing job which sometimes takes (2 hours).

I have observed that there is a lot of delay in message consumption when the consumers are free after completing the previous job.

I have tried setting the max poll interval seconds to 2 or 3 hours but it has not helped.

Below is my consumer config code

```
    consumer_config = {
        'bootstrap.servers': APPCONFIG['BOOTSTRAP_SERVERS'],
        'security.protocol': 'SSL',
        'ssl.keystore.location': APPCONFIG['SSL_KEYSTORE_LOCATION'],
        'ssl.keystore.password': APPCONFIG['SSL_KEYSTORE_PASSWORD'],
        'ssl.ca.location': APPCONFIG['SSL_CA_LOCATION'],
        'group.id': APPCONFIG['GROUP_ID'],
        'auto.offset.reset': 'earliest',
        'max.poll.interval.ms': int(APPCONFIG['MAX_POLL_INTERVAL'])            
    }

```

and below is the processing code

consumer = Consumer(consumer\_config)  
consumer.subscribe([topic])  
consumer.commit()  
p = Processor(message)  
p.start\_processing()
