0
votes

I am going implementing consuming the REST service via spring integration and I have a following code.

    <int:gateway id="myGateway" service-interface="org.moonshiner.MyGateway"/>

<int:channel id="myInputChannel"/>

<int:chain input-channel="myInputChannel">
    <int-http:outbound-gateway
            url="${url}"
            http-method="GET"
            rest-template="oAuth2RestTemplate"
            expected-response-type="java.lang.String">
    </int-http:outbound-gateway>
    <int:transformer ref="myTransformer"/>
</int:chain>

Everything works just fine, but I want to make the same implementation, but instead of consuming REST webservice, I want to read file(s) from a folder when I call my gateway.

Any suggestions please? I tried to use file:inbound-channel-adapter, but I am forced to define poller, which I don't want to, since I want to read a File only when I call my gateway.

1

1 Answers

1
votes

That should be as simple as new File() created in some POJO method to be called from the service-activator.