Вызов одного активатора услуги и другого активатора услуги - PullRequest
0 голосов
/ 07 декабря 2018

У меня есть сомнения в Spring Integration Flow.Можем ли мы назвать один int: service-активатор за другим.Рассмотрим пример ниже.

<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>   

Мой вопрос: можем ли мы сделать это?или мы должны использовать агрегатор.

1 Ответ

0 голосов
/ 07 декабря 2018

Вам нужен другой канал

<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>   
...