Service activators

Service activators are one of the simplest and most useful endpoints—a plain java class whose methods can be invoked on the messages received on a channel. Service activators can either terminate the message processing or pass it on to the next channel for further processing. Let's have a look at the following example. We would like to do some validation or business logic before passing the message on to the next channel. We can define a Java class and annotate it as follows:

@MessageEndpoint
public class PrintFeed {
  @ServiceActivator
  public String upperCase(String input) {
    //Do some business processing before passing the message
    return "Processed Message";
  }
}

In our XML, we can attach the class to a channel so that it processes ...

Get Spring Integration Essentials now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.