Hello @Sharon Nisha Thiruvarul Durai ,
welcome to this moderated Azure community forum.
The IoT Hub ingests data from devices and queues them for other services.
The retention time (the timespan other services can pick message before there are deleted) is 1 to 7 days. By default this is one day.
The Iot Hub can not actively be purged. You need to consume all older messages before you get the latest ones.
There are four ways to get around this:
- You could try to decrease the retention time if possible.
- If you use the default event-hub compatible endpoint, you could try to switch over to a new consumer group (see $default) for your consuming application (e.g. an Azure Function or Azure Stream Analytics).
- You could create a new route with a filter on the CORRECT messages and use that route
- You can make your consuming application more robust and have it filter out and ignore the wrong messages
I hope this explains the way the IoT Hub passes on all messages.
If the response helped, do "Accept Answer". If it doesn't work, please let us know the progress. All community members with similar issues will benefit by doing so. Your contribution is highly appreciated.