I am trying to figure out how to bring in multiple pathvariables for the .payLoadExpression
but havent figures out a way to do that. Do i also have to do something for the .uriVariable
?
This works with just one .payloadExpression
@Bean
public IntegrationFlow getDrugsByIngredientWorkflow() {
return IntegrationFlows
.from(Http.inboundGateway("/drugsbyingcode/name/{name}")
.payloadExpression("#pathVariables.name")
.requestMapping(m -> m.methods(HttpMethod.GET))
.errorChannel(IntegrationConfiguration.CHANNEL_ERROR_REST))
.handle(Http.outboundGateway(url + "/" + "{name}")
.charset("UTF-8")
.httpMethod(HttpMethod.GET)
.uriVariable("name", "payload")
.expectedResponseType(DrugByIngredientResponse.class))
.transform(DrugByIngredientResponse::getDrug)
.get();
}
This does not work
public IntegrationFlow getContraindicationsByDrugcodeAndIcd10WorkFlow() {
return IntegrationFlows
.from(Http.inboundGateway("/drug/{code}/icd10/{icd10}/contraindications")
.payloadExpression("#pathVariables.code" + ',' + "#pathVariables.icd10")
.requestMapping(m -> m.methods(HttpMethod.GET))
.errorChannel(IntegrationConfiguration.CHANNEL_ERROR_REST))
.handle(Http.outboundGateway(url + "/{code}/V22?format=json")
.httpMethod(HttpMethod.GET)
.uriVariable("code", "payload")
.expectedResponseType(String.class))
.get();
}