This is an automated email from the ASF dual-hosted git repository.

davsclaus pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/camel-kamelets.git


The following commit(s) were added to refs/heads/main by this push:
     new 1134bf353 chore: dns-lookup-action sets the header camel-dns reads 
(#3139)
1134bf353 is described below

commit 1134bf35350eaf5d3fcf8c9b8139123410645998
Author: Claus Ibsen <[email protected]>
AuthorDate: Tue Nov 17 08:13:09 2026 +0100

    chore: dns-lookup-action sets the header camel-dns reads (#3139)
    
    The dns component looks up the name in the CamelDnsName header, but the
    Kamelet set CamelDnsDomain, the header of the ip operation. Every message
    failed with "Header CamelDnsName must be specified and not empty". Adds a
    Citrus test, as the Kamelet had none.
    
    Co-authored-by: Claude Opus 5.5 <[email protected]>
---
 kamelets/dns-lookup-action.kamelet.yaml            |  6 ++---
 .../kamelets/dns-lookup-action.kamelet.yaml        |  6 ++---
 .../dns/dns-lookup-action-route.citrus.it.yaml     | 30 ++++++++++++++++++++++
 .../resources/dns/dns-lookup-action-route.yaml     | 30 ++++++++++++++++++++++
 4 files changed, 66 insertions(+), 6 deletions(-)

diff --git a/kamelets/dns-lookup-action.kamelet.yaml 
b/kamelets/dns-lookup-action.kamelet.yaml
index f6b6ae939..448a05e6d 100644
--- a/kamelets/dns-lookup-action.kamelet.yaml
+++ b/kamelets/dns-lookup-action.kamelet.yaml
@@ -50,7 +50,7 @@ spec:
                     expression: "${header[domain-name]}"
                 steps:
                   - setHeader:
-                      name: CamelDnsDomain
+                      name: CamelDnsName
                       expression:
                         simple:
                           expression: "${header[domain-name]}"
@@ -59,14 +59,14 @@ spec:
                     expression: "${header[ce-domainname]}"
                 steps:
                   - setHeader:
-                      name: CamelDnsDomain
+                      name: CamelDnsName
                       expression:
                         simple:
                           expression: "${header[ce-domainname]}"
             otherwise:
               steps:
                 - setHeader:
-                    name: CamelDnsDomain
+                    name: CamelDnsName
                     expression:
                       simple:
                         expression: "${body}"
diff --git 
a/library/camel-kamelets/src/main/resources/kamelets/dns-lookup-action.kamelet.yaml
 
b/library/camel-kamelets/src/main/resources/kamelets/dns-lookup-action.kamelet.yaml
index f6b6ae939..448a05e6d 100644
--- 
a/library/camel-kamelets/src/main/resources/kamelets/dns-lookup-action.kamelet.yaml
+++ 
b/library/camel-kamelets/src/main/resources/kamelets/dns-lookup-action.kamelet.yaml
@@ -50,7 +50,7 @@ spec:
                     expression: "${header[domain-name]}"
                 steps:
                   - setHeader:
-                      name: CamelDnsDomain
+                      name: CamelDnsName
                       expression:
                         simple:
                           expression: "${header[domain-name]}"
@@ -59,14 +59,14 @@ spec:
                     expression: "${header[ce-domainname]}"
                 steps:
                   - setHeader:
-                      name: CamelDnsDomain
+                      name: CamelDnsName
                       expression:
                         simple:
                           expression: "${header[ce-domainname]}"
             otherwise:
               steps:
                 - setHeader:
-                    name: CamelDnsDomain
+                    name: CamelDnsName
                     expression:
                       simple:
                         expression: "${body}"
diff --git 
a/tests/camel-kamelets-itest/src/test/resources/dns/dns-lookup-action-route.citrus.it.yaml
 
b/tests/camel-kamelets-itest/src/test/resources/dns/dns-lookup-action-route.citrus.it.yaml
new file mode 100644
index 000000000..b21279fde
--- /dev/null
+++ 
b/tests/camel-kamelets-itest/src/test/resources/dns/dns-lookup-action-route.citrus.it.yaml
@@ -0,0 +1,30 @@
+# ---------------------------------------------------------------------------
+# 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.
+# ---------------------------------------------------------------------------
+
+name: dns-lookup-action-route-test
+actions:
+  - camel:
+      cli:
+        run:
+          waitForRunningState: false
+          integration:
+            file: "dns/dns-lookup-action-route.yaml"
+  - camel:
+      cli:
+        verify:
+          integration: "dns-lookup-action-route"
+          logMessage: "\"address\":\"apache.org.\""
diff --git 
a/tests/camel-kamelets-itest/src/test/resources/dns/dns-lookup-action-route.yaml
 
b/tests/camel-kamelets-itest/src/test/resources/dns/dns-lookup-action-route.yaml
new file mode 100644
index 000000000..1f342e512
--- /dev/null
+++ 
b/tests/camel-kamelets-itest/src/test/resources/dns/dns-lookup-action-route.yaml
@@ -0,0 +1,30 @@
+# ---------------------------------------------------------------------------
+# 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.
+# ---------------------------------------------------------------------------
+
+- route:
+    from:
+      uri: "timer:tick"
+      parameters:
+        period: "10000"
+        repeatCount: 1
+      steps:
+      - setBody:
+          constant: "apache.org"
+      - to:
+          uri: "kamelet:dns-lookup-action"
+      - to:
+          uri: "kamelet:log-sink"

Reply via email to