You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@camel.apache.org by GitBox <gi...@apache.org> on 2020/12/02 14:35:00 UTC
[GitHub] [camel-k-runtime] nicolaferraro opened a new issue #536: Use default event type with broker
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:
users@infra.apache.org
[GitHub] [camel-k-runtime] nicolaferraro commented on issue #536: Use default event type with broker
Posted by GitBox <gi...@apache.org>.
nicolaferraro commented on issue #536:
URL: https://github.com/apache/camel-k-runtime/issues/536#issuecomment-737267905
Hit this badly today.
You can create in Knative a trigger as:
```
kn trigger create --sink display display-trigger
```
That is a trigger without filters that is expected to receive all events in the broker.
But actually the camel-based source was not specifying any "type" property and there was no failure. The integration worked without issues. The Knative broker was printing misleading errors that seemed not related to the source message, but it was.
I definitely think it's fine to use our default...
----------------------------------------------------------------
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:
users@infra.apache.org
[GitHub] [camel-k-runtime] lburgazzoli commented on issue #536: Use default event type with broker
Posted by GitBox <gi...@apache.org>.
lburgazzoli commented on issue #536:
URL: https://github.com/apache/camel-k-runtime/issues/536#issuecomment-715301566
As far as I remember you can set the default event type in the knative environment as part of the metadata
----------------------------------------------------------------
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:
users@infra.apache.org
[GitHub] [camel-k-runtime] nicolaferraro closed issue #536: Use default event type with broker
Posted by GitBox <gi...@apache.org>.
nicolaferraro closed issue #536:
URL: https://github.com/apache/camel-k-runtime/issues/536
----------------------------------------------------------------
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:
users@infra.apache.org
[GitHub] [camel-k-runtime] lburgazzoli closed issue #536: Use default event type with broker
Posted by GitBox <gi...@apache.org>.
lburgazzoli closed issue #536:
URL: https://github.com/apache/camel-k-runtime/issues/536
----------------------------------------------------------------
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:
users@infra.apache.org
[GitHub] [camel-k-runtime] lburgazzoli commented on issue #536: Use default event type with broker
Posted by GitBox <gi...@apache.org>.
lburgazzoli commented on issue #536:
URL: https://github.com/apache/camel-k-runtime/issues/536#issuecomment-715326153
I guess we should document that type is required for the broker, having a default may not be the best solution IMHO as that value can be used for filtering so two sources with different data should not generate the same 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:
users@infra.apache.org
[GitHub] [camel-k-runtime] nicolaferraro commented on issue #536: Use default event type with broker
Posted by GitBox <gi...@apache.org>.
nicolaferraro commented on issue #536:
URL: https://github.com/apache/camel-k-runtime/issues/536#issuecomment-715295696
No, I was right :D
----------------------------------------------------------------
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:
users@infra.apache.org
[GitHub] [camel-k-runtime] nicolaferraro commented on issue #536: Use default event type with broker
Posted by GitBox <gi...@apache.org>.
nicolaferraro commented on issue #536:
URL: https://github.com/apache/camel-k-runtime/issues/536#issuecomment-715321082
MMh, it does not help, as we use sinkbinding to get references
----------------------------------------------------------------
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:
users@infra.apache.org
[GitHub] [camel-k-runtime] lburgazzoli commented on issue #536: Use default event type with broker
Posted by GitBox <gi...@apache.org>.
lburgazzoli commented on issue #536:
URL: https://github.com/apache/camel-k-runtime/issues/536#issuecomment-715310382
> This one?
>
> https://github.com/apache/camel-k-runtime/blob/cd744faab76e6f0369255460d1e17f44a9a907e4/components/camel-knative/camel-knative-api/src/main/java/org/apache/camel/component/knative/spi/Knative.java#L29
>
yes
> Headers always take precedence, right?
That's is what I recall, if not, it is a bug
----------------------------------------------------------------
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:
users@infra.apache.org
[GitHub] [camel-k-runtime] nicolaferraro commented on issue #536: Use default event type with broker
Posted by GitBox <gi...@apache.org>.
nicolaferraro commented on issue #536:
URL: https://github.com/apache/camel-k-runtime/issues/536#issuecomment-715295111
Forget about it, it's the from part that fails.. this works
----------------------------------------------------------------
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:
users@infra.apache.org
[GitHub] [camel-k-runtime] nicolaferraro commented on issue #536: Use default event type with broker
Posted by GitBox <gi...@apache.org>.
nicolaferraro commented on issue #536:
URL: https://github.com/apache/camel-k-runtime/issues/536#issuecomment-715309040
This one? https://github.com/apache/camel-k-runtime/blob/cd744faab76e6f0369255460d1e17f44a9a907e4/components/camel-knative/camel-knative-api/src/main/java/org/apache/camel/component/knative/spi/Knative.java#L29
Headers always take precedence, right?
----------------------------------------------------------------
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:
users@infra.apache.org
[GitHub] [camel-k-runtime] nicolaferraro commented on issue #536: Use default event type with broker
Posted by GitBox <gi...@apache.org>.
nicolaferraro commented on issue #536:
URL: https://github.com/apache/camel-k-runtime/issues/536#issuecomment-715331972
> I guess we should document that type is required for the broker, having a default may not be the best solution IMHO as that value can be used for filtering so two sources with different data should not generate the same type
Definitely the best solution. Let's close this.
----------------------------------------------------------------
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:
users@infra.apache.org
[GitHub] [camel-k-runtime] nicolaferraro closed issue #536: Use default event type with broker
Posted by GitBox <gi...@apache.org>.
nicolaferraro closed issue #536:
URL: https://github.com/apache/camel-k-runtime/issues/536
----------------------------------------------------------------
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:
users@infra.apache.org