View Javadoc

1   package org.springframework.batch.sample.rabbitmq.processor;
2   
3   import org.springframework.batch.item.ItemProcessor;
4   
5   import java.util.Date;
6   
7   /**
8    * <p>
9    * Simple {@link ItemProcessor} implementation to append a "processed on" {@link Date} to a received message.
10   * </p>
11   */
12  public class MessageProcessor implements ItemProcessor<String, String> {
13  
14      public String process(String message) throws Exception {
15          return "Message: \"" + message + "\" processed on: " + new Date();
16      }
17  }