nicolaferraro opened a new issue #536:
URL: https://github.com/apache/camel-k-runtime/issues/536


   We should improve #326, using the default event type when no header or using 
parameters is used in binding to the broker.
   
   Currently `to("knative:event")` fails if there's no corresponding header 
specifying the event type, but we can fallback to our default 
"org.apache.camel.event".
   
   This is more evident when binding via KameletBinding.
   
   E.g.
   
   This is currently invalid:
   
   ```yaml
   apiVersion: camel.apache.org/v1alpha1
   kind: KameletBinding
   metadata:
     name: timer-source-binding-2
   spec:
     source:
       ref:
         kind: Kamelet
         apiVersion: camel.apache.org/v1alpha1
         name: timer-source
       properties:
         message: Hello Custom Event
         period: 1000
     sink:
       ref:
         kind: Broker
         apiVersion: eventing.knative.dev/v1beta1
         name: default
   ```
   
   To fix it, the type must be set explicitly:
   
   ```yaml
   apiVersion: camel.apache.org/v1alpha1
   kind: KameletBinding
   metadata:
     name: timer-source-binding-2
   spec:
     source:
       ref:
         kind: Kamelet
         apiVersion: camel.apache.org/v1alpha1
         name: timer-source
       properties:
         message: Hello Custom Event
         period: 1000
     sink:
       ref:
         kind: Broker
         apiVersion: eventing.knative.dev/v1beta1
         name: default
       properties:
         type: custom-type
   ```


----------------------------------------------------------------
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]


Reply via email to