title: Service activator method mapping using @Header annotation in Spring Integration
body: <p>I'm developing web app using Spring Integration to route my messages, but I have some problems with passing my header value. My message goes through router and service activator. </p>
  
  <p>The header value is available in a routing method of my router so it seems to be ok. Let's assume that it is not a problem (I checked this by disabling my service activator).</p>
  
  <p>When it comes to my service activator method the following error is thrown: 
  "Failed to find any valid Message-handling methods named <strong><em>process</em></strong> on target class MyService."</p>
  
  <p><strong>my-spring-integration.xml</strong></p>
  
  <pre><code>&lt;channel id="route" /&gt;
  &lt;service-activator method="process" input-channel="route" ref="myService" output-channel="myOutputChannel" /&gt;
  </code></pre>
  
  <p><strong>MyRouter.java</strong></p>
  
  <pre><code>@Component
  public class MyRouter {
  
     public String router(String message, @Header("isValid") boolean isValid) {
        // isValid is "true"
        return "route";
     } 
  
  }
  </code></pre>
  
  <p><strong>MyService.java</strong></p>
  
  <pre><code>@MessageEndpoint
  @Transactional
  public class MyService {
  
     public void process(String message, @Header("isValid") boolean isValid) {
        ...
     }
  
  }
  </code></pre>
  
  <p>Why is that? Are headers values erased after routing? Or my configuration is wrong? I tried to add @ServiceActivator annotation to my process method, but it didn't help.
  Any help will be greatly appreciated.</p>