tarilabs commented on issue #3937:
URL: https://github.com/apache/camel-k/issues/3937#issuecomment-1359360484

   I've tried using the `#class:<fqcn>` instead. The property works with `kamel 
local` but not with Kamelet.
   
   ## flow with local
   
   ```yaml
   # camel-k: language=yaml 
dependency=github:kiegroup.yard/yard-kdtable/camelk-SNAPSHOT
   
   - from:
       uri: "timer:yaml"
       parameters:
         period: "5000"
       steps:
         - setBody:
             constant: "Hello Camel K from yaml"
         - process:
             ref: '#class:org.drools.yard.kdtable.KdtableProcessor'
         - transform:
             simple: "${body.toUpperCase()}"
         - to: "log:info"
   ```
   
   works as expected:
   
   ```
   $ kamel local run test.yaml --verbose -p kdtable=testviakamelcli
   Modeline options have been loaded from source files
   Full command: kamel local run test.yaml --verbose -p kdtable=testviakamelcli 
--dependency=github:kiegroup.yard/yard-kdtable/camelk-SNAPSHOT 
   ...
   
{"timestamp":"2022-12-20T14:33:39.078+01:00","sequence":183,"loggerClassName":"org.slf4j.impl.Slf4jLogger","loggerName":"org.drools.yard.kdtable.KdtableProcessor","level":"INFO","message":"for
 prop key kdtable value Optional[testviakamelcli]","threadName":"Camel 
(camel-1) thread #1 - 
timer://yaml","threadId":17,"mdc":{},"ndc":"","hostName":"mmortari1-mac","processName":"io.quarkus.bootstrap.runner.QuarkusEntryPoint","processId":34051}
   
{"timestamp":"2022-12-20T14:33:39.079+01:00","sequence":184,"loggerClassName":"org.slf4j.impl.Slf4jLogger","loggerName":"info","level":"INFO","message":"Exchange[ExchangePattern:
 InOnly, BodyType: String, Body: HELLO CAMEL K FROM YAML]","threadName":"Camel 
(camel-1) thread #1 - 
timer://yaml","threadId":17,"mdc":{},"ndc":"","hostName":"mmortari1-mac","processName":"io.quarkus.bootstrap.runner.QuarkusEntryPoint","processId":34051}
   ...
   ```
   
   (the value `testviakamelcli` is logged by the log in the route)
   
   ## flow with kamelet (not working 🤷 )
   
   ```yaml
   apiVersion: camel.apache.org/v1alpha1
   kind: Kamelet
   metadata:
     name: mmk
     labels:
       camel.apache.org/kamelet.type: "action"
   spec:
     definition:
       title: "mmk"
       description: prova
       properties:
         kdtable:
           title: prova
           description: prova
           type: object
     dependencies:
     - "camel:core"
     - "camel:kamelet"
     - "github:kiegroup.yard/yard-kdtable/camelk-SNAPSHOT"
     template:
       from:
         uri: "kamelet:source"
         steps:
         - process:
             ref: '#class:org.drools.yard.kdtable.KdtableProcessor'
         - to: "log:info"
   ```
   
   and:
   
   ```yaml
   apiVersion: camel.apache.org/v1alpha1
   kind: KameletBinding
   metadata:
     name: timer-source-binding
   spec:
     source:
       ref:
         kind: Kamelet
         apiVersion: camel.apache.org/v1alpha1
         name: timer-source
       properties:
         message: hello world
         period: 5000
     sink:
       ref:
         kind: Kamelet
         apiVersion: camel.apache.org/v1alpha1
         name: mmk
       properties:
         kdtable: my asd value in KameletBinding
   ```
   
   in the integration pod log
   
   ```
   ...
   2022-12-20 13:31:22,318 INFO  [org.dro.yar.kdt.KdtableProcessor] (Camel 
(camel-1) thread #1 - timer://tick) for prop key kdtable value Optional.empty
   2022-12-20 13:31:22,319 INFO  [info] (Camel (camel-1) thread #1 - 
timer://tick) Exchange[ExchangePattern: InOnly, BodyType: String, Body: hello 
world]
   ...
   ```
   
   ![Screenshot 2022-12-20 at 14 35 
28](https://user-images.githubusercontent.com/1699252/208679691-17c199e4-25e3-4edd-a2f0-284c98f42151.png)
   
   Suggestions, please? 🤔


-- 
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: commits-unsubscr...@camel.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org

Reply via email to