allthingssecurity commented on code in PR #28257:
URL: https://github.com/apache/camel/pull/28257#discussion_r4345341862


##########
components/camel-jte/src/main/java/org/apache/camel/component/jte/JteCodeResolver.java:
##########
@@ -39,9 +39,9 @@ public JteCodeResolver(CamelContext camelContext) {
         this.camelContext = camelContext;
     }
 
-    public void addTemplateFromHeader(String exchangeId, String template) {
-        if (exchangeId != null && template != null) {
-            headerTemplates.put(exchangeId, template);
+    public void addTemplateFromHeader(String name, String template) {
+        if (name != null && template != null) {
+            headerTemplates.put(name, template);

Review Comment:
   Added a two-line comment in `addTemplateFromHeader`. It says that `resolve` 
removes the entry but runs only when the engine compiles the name, so after the 
first exchange the text stays in the map, one copy per distinct template (as in 
the engine). I also added your doc point to the "Dynamic templates" section, 
with the catalog copy updated the same way: each distinct template text from 
the `CamelJteTemplate` header is compiled once and kept until the component 
stops, so those templates should come from a small, known set.
   
   _Claude Code on behalf of allthingssecurity_
   



-- 
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: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to