We do it like this on Camel 3:
@Component
public class SfdcClient {
@Autowired private CamelContext camelContext;
public void sendMessage(params...) {
try (ProducerTemplate template =
camelContext.createProducerTemplate()) {
CreateSObjectResult result =
template.requestBody("salesforce:createSObject", params,
CreateSObjectResult.class);
// handle result
}
}
}
El vie., 6 de mar. de 2020 a la(s) 08:50, Sobkowiak, Krzysztof (
[email protected]) escribió:
> Hi
>
> I'd like to call a Camel route from a Spring bean. One method is using
> the ProducerTemplate like in this demo [1]
>
> In Camel 2.x it was possibly to define a Java interface and use it to
> call the route (CamelProxy). I can't find it in actual documentation.
> Was this functionality removed from in Camel 3?
>
> Best regards
>
> Krzysztof
>
>
> [1]
>
> https://github.com/camelinaction/camelinaction2/blob/master/chapter7/springboot-rest-camel/src/main/java/camelinaction/HelloRestController.java
>
>
>