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
Velocity Support #837
Comments
A contribution is welcome. You may want to follow https://camel.apache.org/camel-quarkus/latest/contributor-guide.html if you are interested. There is also a PR with Freemarker support under review #835 that may have vast similarities to velocity. |
I can take a look at this issue. |
Happy to collaborate on this @zhfeng if I get a chance - that Freemarker pull request does look to have a lot of similarities |
@dc2tom it should be very similar to the freemarker component. At first, you need to create the velocity extension by
anyway, you are welcome to contribute a PR. Feel free to ask here and I will try my best to help you ! |
Hi, I've made a start with this following the Freemarker pull request as an example. I'm working on porting over the unit tests from camel-velocity but there is one thing I'm not getting. When trying to run my test, against the below resource definition @Path("/velocity")
@ApplicationScoped
public class VelocityLetterResource {
@Inject
ProducerTemplate producerTemplate;
@Path("/velocityLetter")
@POST
@Consumes(MediaType.APPLICATION_JSON)
@Produces(MediaType.TEXT_PLAIN)
public String post(String message) {
Exchange exchange = producerTemplate.request("direct:a", new Processor() {
@Override
public void process(Exchange exchange) throws Exception {
exchange.getIn().setHeader("firstName", "Claus");
exchange.getIn().setHeader("lastName", "Ibsen");
exchange.getIn().setHeader("item", "Camel in Action");
exchange.getIn().setBody("PS: Next beer is on me, James");
}
});
return (String) exchange.getOut().getBody();
}
public static class VelocityRouteBuilder extends RouteBuilder {
@Override
public void configure() {
from("direct:a")
.to("velocity:org/apache/camel/quarkus/component/velocity/letter.vm");
}
} I see the following failure:
I can't work out how the RouteBuilder is invoked - my integration tests exist in the org.apache.camel.quarkus.component.velocity.it package.. I auto generated the velocity extension as per the contribution guide. I expected that perhaps my extension would not be able to load the .vm file as I have yet to implement the functionality, but instead it seems the RouteBuilder is not being executed. Any advice appreciated :) |
Sounds like your integration test module is missing the |
Perfect, thanks for the quick response, I'm now in a position to work through porting the rest of the camel-velocity test over. Hopefully I can have a pull request ready in the near future. |
Any progress on this one @dc2tom? I am about to add an auto-generated JVM-only Velocity extension. If you had an integration test ready, going native would be easy. |
I've created a pull request with what I had so far #1634 Unfortunately due to other commitments I wasn't able to progress this further than what I've just uploaded |
@ppalaga I can look at this issue, please assign it to me. |
@zhfeng I've missed your involvement at this issue. Do you plan to continue with it or are you working on it? May I help? |
Hi @JiriOndrusek , feel free to take this issue. |
Fixed via #1804 |
Our team make use of camel-velocity for running message transformations. It would be great to see a camel-quarkus extension supporting velocity.
The text was updated successfully, but these errors were encountered: