This is an automated email from the ASF dual-hosted git repository.
jamesnetherton pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/camel-quarkus.git
The following commit(s) were added to refs/heads/main by this push:
new 68c1d59aab Fixes #8860. Add GraalVM substitution for optional zstd-jni
in httpclient5
68c1d59aab is described below
commit 68c1d59aab649196e44cb92b09d4444a915997df
Author: JiriOndrusek <[email protected]>
AuthorDate: Fri Jul 10 11:10:47 2026 +0200
Fixes #8860. Add GraalVM substitution for optional zstd-jni in httpclient5
Substitute ZstdRuntime.available() to return false when zstd-jni is
absent, preventing native image build failure on unresolved
ZstdDecompressCtx. Follows existing Brotli and Xz substitution pattern.
Co-authored-by: Claude Opus 4.6 <[email protected]>
---
.../graal/ZstdAbsentBooleanSupplier.java | 31 ++++++++++++++++++++
.../httpclient5/graal/ZstdSubstitutions.java | 34 ++++++++++++++++++++++
2 files changed, 65 insertions(+)
diff --git
a/extensions-support/httpclient5/runtime/src/main/java/org/apache/camel/quarkus/support/httpclient5/graal/ZstdAbsentBooleanSupplier.java
b/extensions-support/httpclient5/runtime/src/main/java/org/apache/camel/quarkus/support/httpclient5/graal/ZstdAbsentBooleanSupplier.java
new file mode 100644
index 0000000000..333dd8502c
--- /dev/null
+++
b/extensions-support/httpclient5/runtime/src/main/java/org/apache/camel/quarkus/support/httpclient5/graal/ZstdAbsentBooleanSupplier.java
@@ -0,0 +1,31 @@
+/*
+ * 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.support.httpclient5.graal;
+
+import java.util.function.BooleanSupplier;
+
+public class ZstdAbsentBooleanSupplier implements BooleanSupplier {
+ @Override
+ public boolean getAsBoolean() {
+ try {
+
Thread.currentThread().getContextClassLoader().loadClass("com.github.luben.zstd.ZstdDecompressCtx");
+ return false;
+ } catch (ClassNotFoundException e) {
+ return true;
+ }
+ }
+}
diff --git
a/extensions-support/httpclient5/runtime/src/main/java/org/apache/camel/quarkus/support/httpclient5/graal/ZstdSubstitutions.java
b/extensions-support/httpclient5/runtime/src/main/java/org/apache/camel/quarkus/support/httpclient5/graal/ZstdSubstitutions.java
new file mode 100644
index 0000000000..12a6000591
--- /dev/null
+++
b/extensions-support/httpclient5/runtime/src/main/java/org/apache/camel/quarkus/support/httpclient5/graal/ZstdSubstitutions.java
@@ -0,0 +1,34 @@
+/*
+ * 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.support.httpclient5.graal;
+
+import com.oracle.svm.core.annotate.Substitute;
+import com.oracle.svm.core.annotate.TargetClass;
+
+/**
+ * Remove references to optional com.github.luben:zstd-jni dependency.
+ */
+final class ZstdSubstitutions {
+}
+
+@TargetClass(className = "org.apache.hc.client5.http.impl.ZstdRuntime",
onlyWith = ZstdAbsentBooleanSupplier.class)
+final class SubstituteZstdRuntime {
+ @Substitute
+ public static boolean available() {
+ return false;
+ }
+}