jamesnetherton commented on code in PR #8523:
URL: https://github.com/apache/camel-quarkus/pull/8523#discussion_r3077457925
##########
extensions/ibm-watson-language/runtime/pom.xml:
##########
@@ -43,6 +44,15 @@
<groupId>org.apache.camel</groupId>
<artifactId>camel-ibm-watson-language</artifactId>
</dependency>
+ <dependency>
+ <groupId>org.apache.camel.quarkus</groupId>
+ <artifactId>camel-quarkus-gson</artifactId>
+ </dependency>
Review Comment:
Can we have this instead?
```suggestion
<dependency>
<groupId>com.google.code.gson</groupId>
<artifactId>gson</artifactId>
</dependency>
```
##########
extensions/ibm-watson-language/deployment/src/main/java/org/apache/camel/quarkus/component/ibm/watson/language/deployment/IbmWatsonLanguageProcessor.java:
##########
@@ -0,0 +1,74 @@
+/*
+ * 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.ibm.watson.language.deployment;
+
+import io.quarkus.deployment.annotations.BuildStep;
+import io.quarkus.deployment.builditem.FeatureBuildItem;
+import io.quarkus.deployment.builditem.IndexDependencyBuildItem;
+
+/**
+ * Quarkus extension processor for IBM Watson Natural Language Understanding
support.
+ * <p>
+ * <b>Known Limitation in Native Mode:</b>
+ * In GraalVM native mode, Watson SDK cannot load {@code
java-sdk-version.properties} and
+ * {@code sdk-core-version.properties}, resulting in warning logs:
+ *
+ * <pre>
+ * WARNING [com.ibm.watson.common.SdkCommon] Could not load
java-sdk-version.properties
+ * WARNING [com.ibm.cloud.sdk.core.util.RequestUtils] Could not load file:
sdk-core-version.properties
Review Comment:
The usual fix for this is to first find where those files live on the
classpath. Then register `NativeImageResourceBuildItem` for them.
##########
extensions/ibm-watson-language/deployment/src/main/java/org/apache/camel/quarkus/component/ibm/watson/language/deployment/IbmWatsonLanguageProcessor.java:
##########
@@ -0,0 +1,74 @@
+/*
+ * 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.ibm.watson.language.deployment;
+
+import io.quarkus.deployment.annotations.BuildStep;
+import io.quarkus.deployment.builditem.FeatureBuildItem;
+import io.quarkus.deployment.builditem.IndexDependencyBuildItem;
+
+/**
+ * Quarkus extension processor for IBM Watson Natural Language Understanding
support.
+ * <p>
+ * <b>Known Limitation in Native Mode:</b>
+ * In GraalVM native mode, Watson SDK cannot load {@code
java-sdk-version.properties} and
+ * {@code sdk-core-version.properties}, resulting in warning logs:
+ *
+ * <pre>
+ * WARNING [com.ibm.watson.common.SdkCommon] Could not load
java-sdk-version.properties
+ * WARNING [com.ibm.cloud.sdk.core.util.RequestUtils] Could not load file:
sdk-core-version.properties
+ * </pre>
+ *
+ * These warnings do not affect functionality - Watson SDK falls back to
"unknown-version"
+ * in the User-Agent header, but all API calls work normally.
+ */
+class IbmWatsonLanguageProcessor {
+
+ private static final String FEATURE = "camel-ibm-watson-language";
+
+ @BuildStep
+ FeatureBuildItem feature() {
+ return new FeatureBuildItem(FEATURE);
+ }
+
+ @BuildStep
+ void registerForReflection(
+ io.quarkus.deployment.builditem.CombinedIndexBuildItem
combinedIndex,
Review Comment:
Not sure why, but Claude etc seem to like writing type references using the
FQCN. Please take a scan through this class and replace it with imports so that
the code is more readable.
--
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]