Back to Catalog
Integration
Messaging Endpoints
Selective Consumer
Only receive messages that match your criteria — filter at subscription time, not after.
Intent & Description
Real-world Use Case
Alerting system — subscribes to the transactions topic with selector amount > 50000 AND region = ‘EMEA’. Receives only large EMEA transactions for compliance review. Does not see small transactions or non-EMEA activity. Broker-side filtering keeps the alert handler lean.
Source
📌 TL;DR
Selective Consumer = tell the broker what you want, not what you do not want. Filter at the source. Cleaner than consuming everything and discarding most of it.
Advantages
- Broker-side filtering — consumer receives only relevant messages, zero processing waste
- Consumer logic stays simple — no if/else routing guards needed
- Reduces consumer resource usage (CPU, memory, network)
- Multiple consumers with different selectors can share one topic
Disadvantages
- Not all brokers support rich selector expressions (check your broker)
- Selector expressions are not type-safe — string-based predicates can break silently
- Selector logic is separate from application code — harder to version and test together
- Complex selectors can impact broker performance at high message rates