# Polling Consumer

> Go check the queue yourself on a schedule — simple, controllable, slightly laggy.

- **Category**: Integration
- **Subcategory**: Messaging Endpoints
- **Canonical URL**: https://designpattern.fyi/patterns/polling_consumer/

---

## Description
Clean, reusable architecture pattern.


## Use Cases
Nightly report generator — polls a report-requests queue at midnight. Processes all queued requests in batch, generates reports, then goes idle. Polling fits perfectly — no need for real-time message push.





## Trade-offs


### Advantages

- Consumer controls its own consumption rate — no overload risk

- Simple to implement — just a loop with a sleep or a scheduled job

- Works with almost any storage system used as a queue

- Easy to pause, resume, and debug




### Considerations & Drawbacks

- Polling adds latency — messages wait until the next poll cycle

- Constant polling wastes resources when the queue is empty (use long-polling to mitigate)

- Not suitable for real-time or low-latency processing requirements

- Poll frequency tuning is a balance between latency and resource cost







---
**Reference**: [Original Source](https://www.enterpriseintegrationpatterns.com/patterns/messaging/PollingConsumer.html)

