ppalaga commented on a change in pull request #878: Update to introduce the 
quarkus qute extension
URL: https://github.com/apache/camel-quarkus/pull/878#discussion_r392863874
 
 

 ##########
 File path: 
extensions/qute/runtime/src/main/java/org/apache/camel/quarkus/component/qute/CamelQuteRecorder.java
 ##########
 @@ -0,0 +1,37 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.camel.quarkus.component.qute;
+
+import javax.inject.Inject;
+
+import io.quarkus.qute.Engine;
+import io.quarkus.runtime.RuntimeValue;
+import io.quarkus.runtime.annotations.Recorder;
+import org.apache.camel.component.qute.QuteComponent;
+
+@Recorder
+public class CamelQuteRecorder {
+    @Inject
+    Engine quteEngine;
 
 Review comment:
   I think `quteEngine` will always be null, because CDI does not work in 
recorders. 
   
   Based on this comment, it looks like they instantiate "real engine" only at 
runtime: 
https://github.com/quarkusio/quarkus/blob/master/extensions/qute/deployment/src/main/java/io/quarkus/qute/deployment/QuteProcessor.java#L176
   
   Actually, we could let the Quarkus Qute extension to validate our user's 
templates: It looks like it is enough to make sure that our templates are 
included in the list of `TemplatePathBuildItem`s. As far as I could check, the 
Quarkus Qute extension produces those for all files under `templates`. So we 
should perhaps make it a requirement for the users to store their templates 
under `templates`. WDYT? 
   It should be documented in `docs/modules/ROOT/pages/extensions/qute.adoc` if 
we go that way. In any case, we should add a link to the Qute guide there 
https://quarkus.io/guides/qute
   
   Now, how could we set the "real" Qute engine to our Qute component: I think 
we could try to do something like the OpenTracing extension is doing 
https://github.com/apache/camel-quarkus/blob/master/extensions/opentracing/runtime/src/main/java/org/apache/camel/quarkus/component/opentracing/CamelOpenTracingRecorder.java#L32

----------------------------------------------------------------
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.
 
For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


With regards,
Apache Git Services

Reply via email to