# How to check if there is any message for consumer ? before calling consume method in the C# application

**URL:** <https://forum.confluent.io/t/how-to-check-if-there-is-any-message-for-consumer-before-calling-consume-method-in-the-c-application/4539>\
**Category:** Clients\
**Created:** [23 March 2022 05:39 UTC](https://forum.confluent.io/t/how-to-check-if-there-is-any-message-for-consumer-before-calling-consume-method-in-the-c-application/4539 "2022-03-23T05:39:24Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![k123009](https://avatars.discourse-cdn.com/v4/letter/k/b5e925/32.png) [@k123009](https://forum.confluent.io/u/k123009)\
**Post date:** [23 March 2022 05:39 UTC](https://forum.confluent.io/t/how-to-check-if-there-is-any-message-for-consumer-before-calling-consume-method-in-the-c-application/4539/1 "2022-03-23T05:39:24Z")

</div>

Hello Team,

I am looking for a method that can tell me if there is any message available to consume in the C# application.

**for example**  
`bool HasMessage();`

Any help will be appreciated.

Kind Regards

---

<div class="post-metadata">

**Author:** ![OneCricketeer](https://sea1.discourse-cdn.com/flex019/user_avatar/forum.confluent.io/onecricketeer/32/1551_2.png) [@OneCricketeer](https://forum.confluent.io/u/OneCricketeer)\
**Post date:** [5 April 2022 16:04 UTC](https://forum.confluent.io/t/how-to-check-if-there-is-any-message-for-consumer-before-calling-consume-method-in-the-c-application/4539/2 "2022-04-05T16:04:09Z")

</div>

You could describe the consumer group (using AdminClient class), then check if there is a non-zero the lag of the group for the topic you’re interested in.

If there is lag, then that means that consumer has data to poll.

> <https://stackoverflow.com/questions/60506580/how-can-i-list-the-kafka-consumer-lag-and-latest-offset-per-partition-and-consum>
