barmyard opened a new issue #2139:
URL: https://github.com/apache/camel-k/issues/2139
I am observing errors while writing a YAML integration containing a wiretap
to a Kamelet, here is a minimal example: This example should log "Hello from
Camel K yaml" twice.
```yaml
- from:
uri: "timer:yaml"
parameters:
period: "1000"
steps:
- set-body:
constant: "Hello Camel K from yaml"
- wiretap:
uri: "kamelet:logger?message=${body}"
- to: "log:info"
```
Where the logger Kamelet is just a simple sink Kamelet that logs:
```yaml
apiVersion: camel.apache.org/v1alpha1
kind: Kamelet
metadata:
name: logger
namespace: default
labels:
camel.apache.org/kamelet.type: "sink"
spec:
definition:
title: "Logger"
description: Logger
required:
- message
properties:
message:
title: Message
description: Message
type: string
flow:
from:
uri: "kamelet:source"
steps:
- log: "{{message}}"
```
After `kubectl apply -f ` and `kamel run`, I receive the following error:
`WARN [org.apa.cam.pro.WireTapProcessor] (Camel (camel-1) thread #3 -
WireTap) Error occurred during processing
Exchange[72E859E2207EED5-0000000000000005] wiretap to
kamelet:logger?message=${body}. This exception will be ignored.:
org.apache.camel.NoSuchEndpointException: No endpoint could be found for:
kamelet://logger?message=Hello+Camel+K+from+yaml, please check your classpath
contains the needed Camel component jar.`
Changing the `wiretap` to a `to` statement works: ("Hello .. " is printed
once every second)
```yaml
- from:
uri: "timer:yaml"
parameters:
period: "1000"
steps:
- set-body:
constant: "Hello Camel K from yaml"
- to:
uri: "kamelet:logger?message=${body}"
```
Changing the `kamelet:logger` to the baked in `log` also works: ("Hello .. "
is printed twice every second)
```yaml
- from:
uri: "timer:yaml"
parameters:
period: "1000"
steps:
- set-body:
constant: "Hello Camel K from yaml"
- wiretap:
uri: "log:info"
- to: "log:info"
```
Another interesing thing: when I remove the final `to: log:info` statement,
it doesn't work either:
```yaml
- from:
uri: "timer:yaml"
parameters:
period: "1000"
steps:
- set-body:
constant: "Hello Camel K from yaml"
- wiretap:
uri: "log:info"
```
I am not sure if miss something, or it's a bug. After a discussion on Zulip
chat with @lburgazzoli, he mentions there might be an issue with load
templates. Similar problems arise with components like `enhance`, and I suspect
it might be the same issue.
Mind you: I don't have a lot of Camel (K) experience, so I hope I formulated
everything well.
----------------------------------------------------------------
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:
[email protected]