title: Sending message to serviceActivator in Spring Integration after sending response in TCP gateway
body: <p>My Spring Integration application built on TCP gateway is working well. It takes request message coming to TCP gateway and forwards the message to serviceActivator for preparing the response and the response is sent to the client. </p>
  
  <p>I would like to save the message to database after sending to the client. I am just wondering whether I can forward the message to another serviceActivator after sending the response to the client.</p>
  
  <p>If yes, how should spring configuration be setup? 
  I would appreciate any help in this regard.</p>
  
  <p>Here is the spring context file:</p>
  
  <pre><code>&lt;beans&gt;
      &lt;int-ip:tcp-connection-factory id="crLfServer"
              type="server"
              port="${availableServerSocket}"
              single-use="true"
              so-timeout="10000"
              using-nio="false" 
              serializer="connectionSerializeDeserialize"
              deserializer="connectionSerializeDeserialize"
              /&gt;
  
          &lt;bean id="connectionSerializeDeserialize" class="org.springframework.integration.ip.tcp.serializer.ByteArrayStxEtxSerializer"/&gt;
  
          &lt;int-ip:tcp-inbound-gateway id="gatewayCrLf"
              connection-factory="crLfServer"
              request-channel="serverBytes2StringChannel"
              error-channel="errorChannel"
              reply-timeout="10000"/&gt; &lt;!-- reply-timeout works on inbound-gateway --&gt;
  
          &lt;int:channel id="toSA" /&gt;
  
          &lt;int:service-activator input-channel="toSA"
              ref="myService"
              method="prepare"/&gt;
  
          &lt;int:object-to-string-transformer id="serverBytes2String"
              input-channel="serverBytes2StringChannel"
              output-channel="toSA"/&gt;
  
          &lt;int:transformer id="errorHandler"
              input-channel="errorChannel"
              expression="payload.failedMessage.payload + ':' + payload.cause.message"/&gt;
  &lt;/beans&gt;
  </code></pre>
  
  <p>Thank you</p>