I hava xml that include this :
<channel id="myDataChannel"></channel>
<http:outbound-gateway
request-channel="myDataChannel"
url="{url}/myApi/getData/{id}"
expected-response-type="com.api.dto.Data"
http-method="GET"
rest-template="myRestTemplate">
<http:uri-variable name="url" expression="headers.url" />
</http:outbound-gateway>
and in java code like this :
MessagingTemplate myTemplate = new MessagingTemplate();
Message<?> getDataReply = null;
Data dataDto = null;
Message<?> requestMsg = MessageBuilder.withPayload(requestDto)
.build();
getDataReply = template.sendAndReceive(myDataChannel, requestMsg);
return dataDto = (Data) getDataReply.getPayload();
here is my question how to path id in URL with payload in java code and there is an additional tag should I add to XML in out-bound-gateway ?