You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@camel.apache.org by "Luca Burgazzoli (JIRA)" <ji...@apache.org> on 2017/12/15 15:36:00 UTC

[jira] [Commented] (CAMEL-12086) Service call definition - Simple language expresion in uri is not being evaluated

    [ https://issues.apache.org/jira/browse/CAMEL-12086?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16292683#comment-16292683 ] 

Luca Burgazzoli commented on CAMEL-12086:
-----------------------------------------

Should't it be ${header.fid} instead of plain ${fid} ?

> Service call definition - Simple language expresion in uri is not being evaluated 
> ----------------------------------------------------------------------------------
>
>                 Key: CAMEL-12086
>                 URL: https://issues.apache.org/jira/browse/CAMEL-12086
>             Project: Camel
>          Issue Type: Bug
>    Affects Versions: 2.20.1
>         Environment: Spring boot
>            Reporter: Frantisek Sichinger
>
> I'm facing some problems with service call definition. 
> A route is supposed to send some get requests to a specific endpoint. The endpoint requires a parameter in the url path - {noformat}GET <host>:<port>/api/.../<id>{noformat}
> Route definition:
> {noformat}
>   routebuilder.from("direct:getSomeEntity")
> 	.setHeader(Exchange.HTTP_METHOD, constant(HttpMethod.GET))
> 	.serviceCall()
> 	.name("test")
> 	.uri("test/api/.../${fid}")
> 	.end()
>         ...
> {noformat}
> This route did not work and the {noformat}${fid}{noformat} parameter was never resolved despite the javadoc states that the uri may contain simple language expressions 
> See - {noformat}https://github.com/apache/camel/blob/master/camel-core/src/main/java/org/apache/camel/model/cloud/ServiceCallDefinition.java#L187{noformat}
> Route execution:
> {noformat}
> camelContext.createFluentProducerTemplate()
> 	.withHeader("fid", id)
> 	.to("direct:getSomeEntity")
>         ...
> {noformat}
> Eventually i got it work with following workaround
> {noformat}
> .serviceCall()
> 	.name("test")
> 	.expression()		
> 	.simple("http4://${header.CamelServiceCallServiceHost}:${header.CamelServiceCallServicePort}/api/.../${fid}")
> 	.end()
> {noformat}



--
This message was sent by Atlassian JIRA
(v6.4.14#64029)