Hello @Vikas Kulkarni ,
Welcome to the Microsoft Q&A platform.
Unfortunately, we cannot determine the unread messages in the event hub since it’s only a pull model. We can send events to an event hub and receiver application can receive it, we can’t predict whether messages are read by the client application or not.
Event Hubs retains events for a configured retention time that applies across all partitions. Events are automatically removed when the retention period has been reached. If you specify a retention period of one day, the event will become unavailable exactly 24 hours after it has been accepted. You cannot explicitly delete events.
If you need to archive events beyond the allowed retention period, you can have them automatically stored in Azure Storage or Azure Data Lake by turning on the Event Hubs Capture feature, and if you need to search or analyze such deep archives, you can easily import them into Azure Synapse or other similar stores and analytics platforms.
For more details, see Azure Event Hubs – Event Retention.
Hope this helps. Do let us know if you any further queries.
------------
Please don’t forget to Accept Answer
and Up-Vote
wherever the information provided helps you, this can be beneficial to other community members.