Description
A polling process periodically queries the database for new events (like in an Outbox) and publishes them to a message broker.
Where to use
- Simplest Outbox implementation. \n
- Systems without CDC support.
Real World Example
A Cron job runs every 1 second: SELECT * FROM outbox WHERE sent=false; publish(); UPDATE set sent=true;
Code Example
class PollingPublisher:
def __init__(self):
pass
def execute(self):
print('Executing Polling Publisher')
