1

There are 1 answers

0
Gary Russell On BEST ANSWER

See the Spring Integration documentation.

With a Service Activator the input message is replaced by the output message.

With the enricher; the input message is parked; we send a message (which could be different to the input message) to some downstream flow which returns a result.

We then "enrich" the input message (by adding information from the reply) to produce the output message.

For example; let's say you have an Order object with a customer ID and you want to enhance it by adding the customer name; you can use an enricher to send a lookup request for the customer; then set the customer name property on the order.

You can, of course, do the same thing within your service but with the enricher you don't have to write any code - it's your choice.