JiriOndrusek commented on code in PR #3793:
URL: https://github.com/apache/camel-quarkus/pull/3793#discussion_r876729483


##########
integration-tests/velocity/src/main/java/org/apache/camel/quarkus/component/velocity/it/VelocityResource.java:
##########
@@ -112,6 +115,34 @@ public Response bodyAsDomainObject(Person person, 
@QueryParam("givenName") Strin
                 .build();
     }
 
+    @Path("/velocityContext")
+    @POST
+    @Consumes(MediaType.APPLICATION_JSON)
+    @Produces(MediaType.APPLICATION_JSON)
+    public Response velocityContext(String msg, @QueryParam("name") String 
name, @QueryParam("name2") String name2,
+            @QueryParam("item") String item) throws Exception {
+
+        final Exchange ex = producerTemplate.request(
+                
"velocity://template/velocityContext.vm?allowTemplateFromHeader=true&allowContextMapAll=true",
+                (Processor) exchange -> {
+                    exchange.getIn().setBody("");
+                    exchange.getIn().setHeader("name", name2);
+                    Map<String, Object> variableMap = new HashMap<>();
+                    variableMap.put("headers", CollectionHelper.mapOf("name", 
name));
+                    variableMap.put("body", "Monday");
+                    variableMap.put("properties", exchange.getProperties());

Review Comment:
   (Just pointing to the place, where exchange was originally put into context, 
I switched it for the properties map, therefore now there is no problem)



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscr...@camel.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org

Reply via email to