JiriOndrusek commented on a change in pull request #1050: InfluxDB native 
support #1036
URL: https://github.com/apache/camel-quarkus/pull/1050#discussion_r406318601
 
 

 ##########
 File path: 
extensions/influxdb/deployment/src/main/java/org/apache/camel/quarkus/component/influxdb/deployment/InfluxdbProcessor.java
 ##########
 @@ -0,0 +1,76 @@
+/*
+ * 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.influxdb.deployment;
+
+import io.quarkus.deployment.annotations.BuildProducer;
+import io.quarkus.deployment.annotations.BuildStep;
+import io.quarkus.deployment.builditem.CombinedIndexBuildItem;
+import io.quarkus.deployment.builditem.ExtensionSslNativeSupportBuildItem;
+import io.quarkus.deployment.builditem.FeatureBuildItem;
+import io.quarkus.deployment.builditem.IndexDependencyBuildItem;
+import 
io.quarkus.deployment.builditem.nativeimage.NativeImageProxyDefinitionBuildItem;
+import io.quarkus.deployment.builditem.nativeimage.ReflectiveClassBuildItem;
+import org.influxdb.dto.QueryResult;
+import org.jboss.jandex.DotName;
+import org.jboss.jandex.IndexView;
+
+class InfluxdbProcessor {
+
+    private static DotName INFLUXDB_DTO_PACKAGE = 
DotName.createSimple("org.influxdb.dto");
+
+    private static final String FEATURE = "camel-influxdb";
+
+    @BuildStep
+    FeatureBuildItem feature() {
+
+        return new FeatureBuildItem(FEATURE);
+    }
+
+    @BuildStep
+    void sslSupport(BuildProducer<ExtensionSslNativeSupportBuildItem> 
extensionSslNativeSupport) {
+
+        // Indicates that this extension would like the SSL support to be 
enabled
+        extensionSslNativeSupport.produce(new 
ExtensionSslNativeSupportBuildItem(FEATURE));
+    }
+
+    @BuildStep
+    void clientProxies(BuildProducer<NativeImageProxyDefinitionBuildItem> 
proxies) {
+        proxies.produce(new 
NativeImageProxyDefinitionBuildItem("org.influxdb.impl.InfluxDBService"));
+    }
+
+
+    @BuildStep
+    IndexDependencyBuildItem registerDependencyForIndex() {
+        return new IndexDependencyBuildItem("org.influxdb", "influxdb-java");
+    }
+
+    @BuildStep
+    ReflectiveClassBuildItem registerForReflection(CombinedIndexBuildItem 
combinedIndex) {
+//        IndexView index = combinedIndex.getIndex();
+//
+//        String[] dtos = index.getKnownClasses().stream()
+//                .filter(ci -> 
ci.name().prefix().equals(INFLUXDB_DTO_PACKAGE))
+//                .map(ci -> ci.name().toString())
+//                .sorted()
+//                .toArray(String[]::new);
+//
+//        return new ReflectiveClassBuildItem(true, true, dtos);
 
 Review comment:
   @ppalaga , @lburgazzoli 
   If I understand your previous comments, this should be the desired solution 
- do not name classes by one, but use the whole package name.
   Unfortunately this is not working in native mode.
   In JVM mode I can see that search on the index is correct and returns:
   
   > [org.influxdb.dto.BatchPoints, org.influxdb.dto.BoundParameterQuery, 
org.influxdb.dto.Point, org.influxdb.dto.Pong, org.influxdb.dto.Query, 
org.influxdb.dto.QueryResult]
   
   Is it possible that index is not updated by the new build item from previous 
step (in native), because the desired classes are added in previous step into 
index?

----------------------------------------------------------------
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