-
Notifications
You must be signed in to change notification settings - Fork 186
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add templates config option to the Mustache extension #868
Comments
Wonder if we can pre-compile the templates similar to what we have done for xslt, if the user still need to have the files then resources-config.json could be the way to go but will be user responsability |
Maybe we could also make a little easier to include resource files with properties like:
|
Or even
|
... which is to say that I like the general idea and that we should try to contribute it to Quarkus. |
@aldettinger mind to check if this ^^^ would be possible ? |
As far as I could drill, I've found no way to pre-compile templates on top of camel 3.1. I'm thinking about complementing the mustache component with a kind of "mustache registry" (resourceUri -> pre-compiled-mustache-template). At endpoint creation time, the mustache component could then try to provide a pre-compiled mustache template according to the resource uri. OnExchange processing, the template is resolved with priority from header, then pre-compiled, then as usual. On camel-quarkus side, I guess we would just need to record the "registry" / component initialization. Maybe there is a way to skip the component level and make camel-quarkus store the "mustache registry" in the camel-registry... I don't know. Any advices, inputs, pointers are welcome :) |
I may step back from the fully pre-compiled approach as I'm stuck on mustache object serialization to runtime init phase. I'll check other options. |
Mustache integration tests are now using include-patterns/exclude-patterns for resource inclusion. |
The mustache extension requires that the application developers use
quarkus.native.additional-build-args =-H:ResourceConfigurationFiles=resources-config.json
https://github.com/apache/camel-quarkus/pull/866/files#diff-8dd2b01ede99ee34a76c5e27361d4825R17 to add the templates to the native image.This solution has several drawbacks:
quarkus-platform
- one would have to copy the json file manually.There are two ways this handled in other extensions:
Include/exclude patterns like in https://github.com/apache/camel-quarkus/blob/master/extensions/core/runtime/src/main/java/org/apache/camel/quarkus/core/CamelConfig.java#L75-L100
List of files or directories like in 161ddb1#diff-56b018479519fc93fac85a776b5c285aR38
The text was updated successfully, but these errors were encountered: