# Service Activator

> Bridge between a message channel and a service call — message in, service invoked, reply out.

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

---

## Description
Clean, reusable architecture pattern.


## Use Cases
OrderValidationService is a plain POJO with a validate(Order) method. Service Activator listens to order-validation-queue, deserializes the message to an Order, calls service.validate(order), and publishes the ValidationResult to the reply channel. OrderValidationService has zero messaging code.





## Trade-offs


### Advantages

- Service logic stays pure — no messaging code in the domain

- Services are independently testable without any broker infrastructure

- Easy to add messaging support to existing services

- Activator is reusable across different services and channels




### Considerations & Drawbacks

- Additional indirection between message and service

- Error handling in the activator layer must be explicit

- Debugging requires understanding both activator and service behavior

- One activator per service per channel — can proliferate







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

