[jira] [Commented] (CAMEL-18477) knative producer with ProducerTemplate is missing the fromRouteId

2022-09-07 Thread Zineb Bendhiba (Jira)


[ 
https://issues.apache.org/jira/browse/CAMEL-18477?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17601322#comment-17601322
 ] 

Zineb Bendhiba commented on CAMEL-18477:


My mistake I missed the possibility to add those with header

> knative producer with ProducerTemplate is missing the fromRouteId
> -
>
> Key: CAMEL-18477
> URL: https://issues.apache.org/jira/browse/CAMEL-18477
> Project: Camel
>  Issue Type: Bug
>  Components: camel-knative
>Affects Versions: 3.18.1
>Reporter: Zineb Bendhiba
>Assignee: Zineb Bendhiba
>Priority: Major
> Fix For: 3.18.3, 3.19.0
>
>
> Knative camel producer creates CloudEvents. To have a valid CloudEvent, 
> there's the need to have a field named `source`.
> The knative camel producer sets this value by putting the "fromRouteId" 
> value. This value is set by DefaultConsumer when creating the extended 
> exchange.
> However, when using the knative producer via ProducerTemplate, we miss this 
> value. And the event is rejected because source is required by knative.
> Log :
> {code:java}
> {"level":"warn","ts":"2022-09-07T10:28:15.844Z","logger":"mt_broker_ingress","caller":"ingress/ingress_handler.go:145","msg":"failed
>  to validate extracted event","error":"source: REQUIRED\n"} {code}
> As a temporary fix, we could ask user to override the source value, as in 
> this configuration example :
> {code:java}
> {
>   "type": "event",
>   "name": "YOUR_NAME_EVENT",
>   "url": "YOUR_LINK_TO_BROKER",
>   "metadata": {
> "camel.endpoint.kind": "sink"
>   },
>   "ceOverrides": {
> "ce-source": "YOUR_SOURCE_NAME"
>   }
> } {code}
> However, it doesn't seem right to suppose in the code this value is coming 
> necessarly from a Camel Consumer.



--
This message was sent by Atlassian Jira
(v8.20.10#820010)


[jira] [Commented] (CAMEL-18477) knative producer with ProducerTemplate is missing the fromRouteId

2022-09-07 Thread Luca Burgazzoli (Jira)


[ 
https://issues.apache.org/jira/browse/CAMEL-18477?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17601317#comment-17601317
 ] 

Luca Burgazzoli commented on CAMEL-18477:
-

I'd say that it works as designed as the component tries to se some sensible 
defaults but some of the attributes are expected to be set the the user. This 
is particularly true for source and event type as those are business attributes 
an we cannot reliably compute/derive them.

The idea is that if you need to customize any attribute, then a user should set 
one of the CamelCloudEvent* header so with the ProducerTemplate tou should use 
sendBodyWithHeader or similar methods

> knative producer with ProducerTemplate is missing the fromRouteId
> -
>
> Key: CAMEL-18477
> URL: https://issues.apache.org/jira/browse/CAMEL-18477
> Project: Camel
>  Issue Type: Bug
>  Components: camel-knative
>Affects Versions: 3.18.1
>Reporter: Zineb Bendhiba
>Assignee: Zineb Bendhiba
>Priority: Major
> Fix For: 3.18.3, 3.19.0
>
>
> Knative camel producer creates CloudEvents. To have a valid CloudEvent, 
> there's the need to have a field named `source`.
> The knative camel producer sets this value by putting the "fromRouteId" 
> value. This value is set by DefaultConsumer when creating the extended 
> exchange.
> However, when using the knative producer via ProducerTemplate, we miss this 
> value. And the event is rejected because source is required by knative.
> Log :
> {code:java}
> {"level":"warn","ts":"2022-09-07T10:28:15.844Z","logger":"mt_broker_ingress","caller":"ingress/ingress_handler.go:145","msg":"failed
>  to validate extracted event","error":"source: REQUIRED\n"} {code}
> As a temporary fix, we could ask user to override the source value, as in 
> this configuration example :
> {code:java}
> {
>   "type": "event",
>   "name": "YOUR_NAME_EVENT",
>   "url": "YOUR_LINK_TO_BROKER",
>   "metadata": {
> "camel.endpoint.kind": "sink"
>   },
>   "ceOverrides": {
> "ce-source": "YOUR_SOURCE_NAME"
>   }
> } {code}
> However, it doesn't seem right to suppose in the code this value is coming 
> necessarly from a Camel Consumer.



--
This message was sent by Atlassian Jira
(v8.20.10#820010)


[jira] [Commented] (CAMEL-18477) knative producer with ProducerTemplate is missing the fromRouteId

2022-09-07 Thread Claus Ibsen (Jira)


[ 
https://issues.apache.org/jira/browse/CAMEL-18477?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17601295#comment-17601295
 ] 

Claus Ibsen commented on CAMEL-18477:
-

Also IMHO it should be possible to set a custom source, what if there is a 
Camel header set on the Exchange message with CamelCloudEventSource as the key?

> knative producer with ProducerTemplate is missing the fromRouteId
> -
>
> Key: CAMEL-18477
> URL: https://issues.apache.org/jira/browse/CAMEL-18477
> Project: Camel
>  Issue Type: Bug
>  Components: camel-knative
>Affects Versions: 3.18.1
>Reporter: Zineb Bendhiba
>Assignee: Zineb Bendhiba
>Priority: Major
> Fix For: 3.18.3, 3.19.0
>
>
> Knative camel producer creates CloudEvents. To have a valid CloudEvent, 
> there's the need to have a field named `source`.
> The knative camel producer sets this value by putting the "fromRouteId" 
> value. This value is set by DefaultConsumer when creating the extended 
> exchange.
> However, when using the knative producer via ProducerTemplate, we miss this 
> value. And the event is rejected because source is required by knative.
> Log :
> {code:java}
> {"level":"warn","ts":"2022-09-07T10:28:15.844Z","logger":"mt_broker_ingress","caller":"ingress/ingress_handler.go:145","msg":"failed
>  to validate extracted event","error":"source: REQUIRED\n"} {code}
> As a temporary fix, we could ask user to override the source value, as in 
> this configuration example :
> {code:java}
> {
>   "type": "event",
>   "name": "YOUR_NAME_EVENT",
>   "url": "YOUR_LINK_TO_BROKER",
>   "metadata": {
> "camel.endpoint.kind": "sink"
>   },
>   "ceOverrides": {
> "ce-source": "YOUR_SOURCE_NAME"
>   }
> } {code}
> However, it doesn't seem right to suppose in the code this value is coming 
> necessarly from a Camel Consumer.



--
This message was sent by Atlassian Jira
(v8.20.10#820010)


[jira] [Commented] (CAMEL-18477) knative producer with ProducerTemplate is missing the fromRouteId

2022-09-07 Thread Claus Ibsen (Jira)


[ 
https://issues.apache.org/jira/browse/CAMEL-18477?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17601294#comment-17601294
 ] 

Claus Ibsen commented on CAMEL-18477:
-

Maybe you can make the code fallback and use camel context id as source if 
route id is empty

> knative producer with ProducerTemplate is missing the fromRouteId
> -
>
> Key: CAMEL-18477
> URL: https://issues.apache.org/jira/browse/CAMEL-18477
> Project: Camel
>  Issue Type: Bug
>  Components: camel-knative
>Affects Versions: 3.18.1
>Reporter: Zineb Bendhiba
>Assignee: Zineb Bendhiba
>Priority: Major
> Fix For: 3.19.0
>
>
> Knative camel producer creates CloudEvents. To have a valid CloudEvent, 
> there's the need to have a field named `source`.
> The knative camel producer sets this value by putting the "fromRouteId" 
> value. This value is set by DefaultConsumer when creating the extended 
> exchange.
> However, when using the knative producer via ProducerTemplate, we miss this 
> value. And the event is rejected because source is required by knative.
> Log :
> {code:java}
> {"level":"warn","ts":"2022-09-07T10:28:15.844Z","logger":"mt_broker_ingress","caller":"ingress/ingress_handler.go:145","msg":"failed
>  to validate extracted event","error":"source: REQUIRED\n"} {code}
> As a temporary fix, we could ask user to override the source value, as in 
> this configuration example :
> {code:java}
> {
>   "type": "event",
>   "name": "YOUR_NAME_EVENT",
>   "url": "YOUR_LINK_TO_BROKER",
>   "metadata": {
> "camel.endpoint.kind": "sink"
>   },
>   "ceOverrides": {
> "ce-source": "YOUR_SOURCE_NAME"
>   }
> } {code}
> However, it doesn't seem right to suppose in the code this value is coming 
> necessarly from a Camel Consumer.



--
This message was sent by Atlassian Jira
(v8.20.10#820010)


[jira] [Commented] (CAMEL-18477) knative producer with ProducerTemplate is missing the fromRouteId

2022-09-07 Thread Zineb Bendhiba (Jira)


[ 
https://issues.apache.org/jira/browse/CAMEL-18477?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17601291#comment-17601291
 ] 

Zineb Bendhiba commented on CAMEL-18477:


[~lburgazzoli] Do you happen to have any opinion on this? I'd be happy to do 
the fix

> knative producer with ProducerTemplate is missing the fromRouteId
> -
>
> Key: CAMEL-18477
> URL: https://issues.apache.org/jira/browse/CAMEL-18477
> Project: Camel
>  Issue Type: Bug
>  Components: camel-knative
>Affects Versions: 3.18.1
>Reporter: Zineb Bendhiba
>Assignee: Zineb Bendhiba
>Priority: Major
> Fix For: 3.19.0
>
>
> Knative camel producer creates CloudEvents. To have a valid CloudEvent, 
> there's the need to have a field named `source`.
> The knative camel producer sets this value by putting the "fromRouteId" 
> value. This value is set by DefaultConsumer when creating the extended 
> exchange.
> However, when using the knative producer via ProducerTemplate, we miss this 
> value. And the event is rejected because source is required by knative.
> Log :
> {code:java}
> {"level":"warn","ts":"2022-09-07T10:28:15.844Z","logger":"mt_broker_ingress","caller":"ingress/ingress_handler.go:145","msg":"failed
>  to validate extracted event","error":"source: REQUIRED\n"} {code}
> As a temporary fix, we could ask user to override the source value, as in 
> this configuration example :
> {code:java}
> {
>   "type": "event",
>   "name": "YOUR_NAME_EVENT",
>   "url": "YOUR_LINK_TO_BROKER",
>   "metadata": {
> "camel.endpoint.kind": "sink"
>   },
>   "ceOverrides": {
> "ce-source": "YOUR_SOURCE_NAME"
>   }
> } {code}
> However, it doesn't seem right to suppose in the code this value is coming 
> necessarly from a Camel Consumer.



--
This message was sent by Atlassian Jira
(v8.20.10#820010)