nicolaferraro commented on pull request #1637:
URL: https://github.com/apache/camel-k/pull/1637#issuecomment-669812820


   > @nicolaferraro do you have an example of a sinkbinding declaration with a 
regular integration?
   
   @heiko-braun this is an (working) integration that results as a regular 
Knative source:
   
   ```yaml
   apiVersion: camel.apache.org/v1
   kind: Integration
   metadata:
     name: source
   spec:
     flows:
     - from:
         uri: timer:tick
         parameters:
           period: "1000"
         steps:
         - set-body:
             constant: Hello SinkBinding !!!
         - transform:
             simple: ${body.toUpperCase()}
         - to: log:info
           # the following line may also be split into k/v format (to be 
implemented)
         - to: 
knative:channel/messages?apiVersion=messaging.knative.dev/v1beta1&kind=InMemoryChannel
     traits:
       knative:
         configuration:
           sinkBinding: true # we may default it to true in the future to avoid 
this setting
   ```
   
   A **future** simplified version may look like:
   
   ```yaml
   apiVersion: camel.apache.org/v1
   kind: Integration
   metadata:
     name: source
   spec:
     flows:
     - from:
         uri: timer:tick
         parameters:
           period: "1000"
         steps:
         - set-body:
             constant: Hello SinkBinding !!!
         - transform:
             simple: ${body.toUpperCase()}
         - to: log:info
         - to:
             uri: knative:endpoint
             parameters:
               apiVersion: messaging.knative.dev/v1beta1
               kind: InMemoryChannel
               name: messages
   ```
   
   Which is very close to the equivalent CamelSource (current working 
implementation):
   
   ```yaml
   apiVersion: sources.knative.dev/v1alpha1
   kind: CamelSource
   metadata:
     name: source
   spec:
     source:
       flow:
         from:
           uri: timer:tick
           parameters:
             period: "1000"
           steps:
           - set-body:
               constant: Hello Old CamelSource !!!
           - transform:
               simple: ${body.toUpperCase()}
           - to: log:info
     sink:
       ref:
         apiVersion: messaging.knative.dev/v1beta1
         kind: InMemoryChannel
         name: messages
   ```


----------------------------------------------------------------
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:
us...@infra.apache.org


Reply via email to