Q:

Calling one service activator and another service activator

I have a doubt in Spring Integration Flow. Can we call one int:service-activator after another . Consider below example.
<int:channel id="getPresciption" />
<int:channel id="respPrescription" />       

<int-http:inbound-gateway
    request-channel="getPresciption" reply-channel="respPrescription"
    supported-methods="GET" path="/getAllPresciption">

    <int-http:request-mapping
        consumes="application/json" produces="application/json" />
</int-http:inbound-gateway>

<int:service-activator
    ref="medicineServiceActivator" method="buildPrescription"
    input-channel="respPrescription"  output-channel="respPrescription" />

<int:service-activator
    ref="medicineServiceActivator" method="storePrescription"
    input-channel="respPrescription"></int:service-activator>   

My Qoestion is can we do this. 
or we have to use Aggregator.

A:

You need another channel
<int:service-activator
    ref="medicineServiceActivator" method="buildPrescription"
    input-channel="respPrescription"  output-channel="toStorePrescription" />

<int:service-activator
    ref="medicineServiceActivator" method="storePrescription"
    input-channel="toStorePrescription"></int:service-activator>   

