# Smart Proxy

> Intercept messages transparently to add cross-cutting functionality — security, logging, throttling.

- **Category**: Integration
- **Subcategory**: System Management
- **Canonical URL**: https://designpattern.fyi/patterns/smart_proxy/

---

## Description
Clean, reusable architecture pattern.


## Use Cases
Partner API rate limiting — partner systems publish to an orders channel. Smart Proxy intercepts, checks partner quota (rate limit), logs the message with partner ID, and forwards to the real orders processing channel only if within quota. Neither the partner system nor the order processor knows the proxy exists.





## Trade-offs


### Advantages

- Add cross-cutting concerns without modifying producers or consumers

- Transparent to both ends — they see the same channel interface

- Centralizes cross-cutting logic (auth, rate limiting, logging) in one place

- Can be added to existing flows without redeployment of connected components




### Considerations & Drawbacks

- Proxy is in the critical message path — must be fast and HA

- Adds latency for every message

- Proxy logic bugs affect all messages flowing through it

- Cross-cutting concerns in the proxy can become over-complicated







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

