title: Spring integration DSL: configure handler that handles only when the argument matches
body: <p>I am using Spring Integration DSL configs. Is it possible to add a method reference handler such that the handler is invoked only when the message payload matches the handler argument type?</p>
  
  <p>For example: in the following code, if the payload is <code>MyObject2</code>, Spring will throw ClassCastException at <code>handleMessage</code>. Instead, what I want to do is to bypass <code>handleMessage</code> and get picked up by <code>handleMessage2</code>. </p>
  
  <pre><code>@Bean
  public IntegrationFlow myFlow() {
    return IntegrationFlows
                  .from("myChannel")
                  .handle(this::handleMessage)
                  .handle(this::handleMessage2)
                  ...
  }
  
  public MyObject2 handleMessage(MyObject o, Map headers){
  ...
  }
  
  public MyObject2 handleMessage(MyObject2 o, Map headers){
  ...
  }
  </code></pre>