title: Spring Integration no output-channel or replyChannel
body: <p>I am working on a scenario where I have to get token in 1st call and then validate that token in the 2nd call.</p>
  <p>My spring integration files looks like</p>
  <pre><code>&lt;?xml version=&quot;1.0&quot; encoding=&quot;UTF-8&quot;?&gt;
  &lt;beans xmlns=&quot;http://www.springframework.org/schema/beans&quot;
         xmlns:xsi=&quot;http://www.w3.org/2001/XMLSchema-instance&quot;
         xmlns:integration=&quot;http://www.springframework.org/schema/integration&quot;
         xmlns:ws=&quot;http://www.springframework.org/schema/integration/ws&quot;
         xmlns:http=&quot;http://www.springframework.org/schema/integration/http&quot;
         xsi:schemaLocation=&quot;http://www.springframework.org/schema/integration/http http://www.springframework.org/schema/integration/http/spring-integration-http.xsd
         http://www.springframework.org/schema/integration/ws http://www.springframework.org/schema/integration/ws/spring-integration-ws.xsd
         http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans.xsd
  http://www.springframework.org/schema/integration http://www.springframework.org/schema/integration/spring-integration.xsd&quot;&gt;
  
      &lt;!-- Entry channel into this flow is ucipTopupChannel --&gt;
  
      &lt;integration:transformer id=&quot;ayobaSmsRequestTransformer&quot;
                               input-channel=&quot;ayobaSMSChannel&quot;
                               output-channel=&quot;ayobaSmsTransformerOutputChannel&quot;
                               ref=&quot;ayobaSmsTransformer&quot;
                               method=&quot;ayobaSmsRequestTransform&quot; /&gt;
  
      &lt;integration:channel id=&quot;ayobaSmsTransformerOutputChannel&quot; /&gt;
  
      &lt;integration:header-value-router id=&quot;ayobaSmsValidationRouter&quot; input-channel=&quot;ayobaSmsTransformerOutputChannel&quot; header-name=&quot;VALIDATION&quot;&gt;
          &lt;integration:mapping value=&quot;FAILED&quot; channel=&quot;ayobaSmsValidationFailedChannel&quot;  /&gt;
          &lt;integration:mapping value=&quot;PASSED&quot; channel=&quot;ayobaSmsValidationRouterOutputChannel&quot; /&gt;
      &lt;/integration:header-value-router&gt;
  
      &lt;integration:channel id=&quot;ayobaSmsValidationFailedChannel&quot; /&gt;
  
      &lt;integration:service-activator input-channel=&quot;ayobaSmsValidationFailedChannel&quot; ref=&quot;validationFailedServiceActivator&quot; /&gt;
  
      &lt;integration:channel id=&quot;ayobaSmsValidationRouterOutputChannel&quot; /&gt;
  
      &lt;integration:object-to-json-transformer id=&quot;ayobaJsonTransformer&quot;
                                              input-channel=&quot;ayobaSmsValidationRouterOutputChannel&quot;
                                              output-channel=&quot;ayobaJsonChannel&quot;
                                              object-mapper=&quot;customObjectMapper&quot;
                                              content-type=&quot;application/json&quot; /&gt;
  
      &lt;integration:channel id=&quot;ayobaJsonChannel&quot; /&gt;
  
      &lt;http:outbound-gateway id=&quot;ayobaSmsOutboundGateway&quot;
                             extract-request-payload=&quot;true&quot;
                             url-expression=&quot;headers['url']&quot;
                             request-channel=&quot;ayobaJsonChannel&quot;
                             reply-channel=&quot;ayobaSmsOutputChannel&quot;
                             mapped-request-headers=&quot;contentType,ERSREFERENCE,Authorization&quot;
                             expected-response-type=&quot;java.lang.String&quot;
                             rest-template=&quot;ayobaRestTemplate&quot; /&gt;
  
      &lt;integration:transformer id=&quot;ayobaSmsResponseTransformer&quot;
                               input-channel=&quot;ayobaSmsOutputChannel&quot;
                               ref=&quot;ayobaSmsTransformer&quot;
                               method=&quot;ayobaSmsResponseTransform&quot; /&gt;
  
      &lt;integration:channel id=&quot;ayobaSmsOutputChannel&quot; /&gt;
  
  
  &lt;/beans&gt;
  </code></pre>
  <p>But now I have to check tokenExpiry for which I am trying to save my extra call, but I am getting below error</p>
  <blockquote>
  <p>Caused by: org.springframework.messaging.core.DestinationResolutionException: no output-channel or replyChannel header available</p>
  </blockquote>
  <p>and my config file looks like</p>
  <pre><code>&lt;?xml version=&quot;1.0&quot; encoding=&quot;UTF-8&quot;?&gt;
  &lt;beans xmlns=&quot;http://www.springframework.org/schema/beans&quot;
         xmlns:xsi=&quot;http://www.w3.org/2001/XMLSchema-instance&quot;
         xmlns:integration=&quot;http://www.springframework.org/schema/integration&quot;
         xmlns:ws=&quot;http://www.springframework.org/schema/integration/ws&quot;
         xmlns:http=&quot;http://www.springframework.org/schema/integration/http&quot;
         xsi:schemaLocation=&quot;http://www.springframework.org/schema/integration/http http://www.springframework.org/schema/integration/http/spring-integration-http.xsd
         http://www.springframework.org/schema/integration/ws http://www.springframework.org/schema/integration/ws/spring-integration-ws.xsd
         http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans.xsd
  http://www.springframework.org/schema/integration http://www.springframework.org/schema/integration/spring-integration.xsd&quot;&gt;
  
      &lt;!-- Entry channel into this flow is ucipTopupChannel --&gt;
  
      &lt;integration:transformer id=&quot;ayobaSmsRequestTransformer&quot;
                               input-channel=&quot;ayobaSMSChannel&quot;
                               output-channel=&quot;ayobaSmsTransformerOutputChannel&quot;
                               ref=&quot;ayobaSmsTransformer&quot;
                               method=&quot;ayobaSmsRequestTransform&quot; /&gt;
  
      &lt;integration:channel id=&quot;ayobaSmsTransformerOutputChannel&quot; /&gt;
  
      &lt;integration:header-value-router id=&quot;ayobaSmsValidationRouter&quot; input-channel=&quot;ayobaSmsTransformerOutputChannel&quot; header-name=&quot;VALIDATION&quot;&gt;
          &lt;integration:mapping value=&quot;FAILED&quot; channel=&quot;ayobaSmsValidationFailedChannel&quot;  /&gt;
          &lt;integration:mapping value=&quot;PASSED&quot; channel=&quot;ayobaSmsValidationRouterOutputChannel&quot; /&gt;
          &lt;integration:mapping value=&quot;CACHED&quot; channel=&quot;ayobaSmsOutputChannel&quot; /&gt;
      &lt;/integration:header-value-router&gt;
  
      &lt;integration:channel id=&quot;ayobaSmsValidationFailedChannel&quot; /&gt;
  
      &lt;integration:service-activator input-channel=&quot;ayobaSmsValidationFailedChannel&quot; ref=&quot;validationFailedServiceActivator&quot; output-channel=&quot;ayobaSmsOutputChannel&quot; requires-reply=&quot;false&quot; /&gt;
  
      &lt;integration:channel id=&quot;ayobaSmsValidationRouterOutputChannel&quot; /&gt;
  
      &lt;integration:object-to-json-transformer id=&quot;ayobaJsonTransformer&quot;
                                              input-channel=&quot;ayobaSmsValidationRouterOutputChannel&quot;
                                              output-channel=&quot;ayobaJsonChannel&quot;
                                              object-mapper=&quot;customObjectMapper&quot;
                                              content-type=&quot;application/json&quot; /&gt;
  
  
      &lt;integration:channel id=&quot;ayobaJsonChannel1&quot; /&gt;
  
      &lt;http:outbound-gateway id=&quot;ayobaSmsOutboundGateway&quot;
                             extract-request-payload=&quot;true&quot;
                             url-expression=&quot;headers['url']&quot;
                             request-channel=&quot;ayobaJsonChannel&quot;
                             reply-channel=&quot;ayobaSmsOutputChannel&quot;
                             mapped-request-headers=&quot;contentType,ERSREFERENCE,Authorization&quot;
                             expected-response-type=&quot;java.lang.String&quot;
                             rest-template=&quot;ayobaRestTemplate&quot; /&gt;
  
      &lt;integration:channel id=&quot;ayobaJsonChannel&quot; /&gt;
  
      &lt;http:outbound-gateway id=&quot;ayobaSmsOutboundGateway&quot;
                             extract-request-payload=&quot;true&quot;
                             url-expression=&quot;headers['url']&quot;
                             request-channel=&quot;ayobaJsonChannel&quot;
                             reply-channel=&quot;ayobaSmsOutputChannel&quot;
                             mapped-request-headers=&quot;contentType,ERSREFERENCE,Authorization&quot;
                             expected-response-type=&quot;java.lang.String&quot;
                             rest-template=&quot;ayobaRestTemplate&quot; /&gt;
  
      &lt;integration:transformer id=&quot;ayobaSmsResponseTransformer&quot;
                               input-channel=&quot;ayobaSmsOutputChannel&quot;
                               ref=&quot;ayobaSmsTransformer&quot;
                               method=&quot;ayobaSmsResponseTransform&quot; /&gt;
  
      &lt;integration:channel id=&quot;ayobaSmsOutputChannel&quot; /&gt;
  
  
  &lt;/beans&gt;
  </code></pre>
  <p>Now, I am startled because for the last channel <code>ayobaSmsResponseTransformer</code>, it works fine for the validation call and doesn't give error, but for my Cached Token call, it is throwing exception.</p>