You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
// Hee is the Bean@ApplicationScoped@Named("StringTemplateBean")
@RegisterForReflectionpublicclassTemplateBean {
publicStringgetTemplate(@Header("template") Stringtemplate) {
returntemplate;
}
}
...
// THIS IS OK no problem here from("timer:timer?period=5s")
.routeId(this.getClass().getName())
.setHeader("template", constant("Hi my name is <headers.name>"))
.setHeader("name", constant("Stop di Hode>"))
.to("bean:StringTemplateBean")
.log("${body}");
// This route give me above mentioned errorfrom("timer:timer?period=5s")
.routeId(this.getClass().getName())
.setHeader("template", constant("Hi my name is <headers.name>"))
.setHeader("name", constant("Stop di Hode>"))
.to("string-template:bean:StringTemplateBean")
.log("${body}");
Quarkus Version 1.13.7.Final
I added camel extension linked to this version
The text was updated successfully, but these errors were encountered:
AFAIK there is no support in the stringtemplate component to do bean lookups in the way you're describing. The URI path is meant to be the location of the template on the classpath.
Hi @jamesnetherton thank you for your response , in the doc's it says it is possible , look at the last line
Required Path to the resource. You can prefix with: classpath, file, http, ref, or bean. classpath, file and http loads the resource using these protocols (classpath is default). ref will lookup the resource in the registry. bean will call a method on a bean to be used as the resource. For bean you can specify the method name after dot, eg bean:myBean.myMethod.
You are using the bean the wrong way, its not to lookup a bean and dynamic call a method on that bean. The bean should be a string or input stream that has the template.
Hi @davsclaus thanks for your response. Okay I understand now and did not see that option on the string template (my bad). But you understand why I came to that conclusion to use the bean that way. In the mean time I solved my route another way.
camel quarkus cannot find resource error
Quarkus Version 1.13.7.Final
I added camel extension linked to this version
The text was updated successfully, but these errors were encountered: