Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

CamelCloudEventXXX not converted to CE header #177

Closed
nicolaferraro opened this issue Oct 27, 2019 · 2 comments · Fixed by #178
Closed

CamelCloudEventXXX not converted to CE header #177

nicolaferraro opened this issue Oct 27, 2019 · 2 comments · Fixed by #178
Assignees

Comments

@nicolaferraro
Copy link
Member

I'm setting header CamelCloudEventType to "something" during an integration, but it's not converted to ce-type going out.

In general, should we tell users to set "ce-type" or "CamelCloudEventType" when they want to override that field?

The same question for CE extensions. Should they use "ce-author" or "CamelCloudEventAuthor"?
"ce-author" may seem obvious, but extensions are not always mapped to http headers, especially when using structured json output.

Dump attached:

POST / HTTP/1.1
Host: dumper.default.svc
User-Agent: Vert.x-WebClient/3.8.1
Content-Length: 3
Accept-Encoding: gzip
Ce-Author: Nicola Ferraro
Ce-Chat: 158584902
Ce-Id: ID-bot-source-r2tnr-74c4cd6d48-68zkg-1572176653802-0-1
Ce-Source: camel-source:default/bot-source
Ce-Specversion: 0.3
Ce-Time: 2019-10-27T11:44:13.8Z
Ce-Type: org.apache.camel.event
Content-Type: text/plain
Forwarded: for=172.17.0.27;proto=http, for=172.17.0.10
K-Proxy-Request: activator
X-B3-Sampled: 1
X-B3-Spanid: 0700a32370b41102
X-B3-Traceid: 9035b130ad9a32340700a32370b41102
X-Envoy-Decorator-Operation: dumper-xbn7f.default.svc.cluster.local:80/*
X-Envoy-Expected-Rq-Timeout-Ms: 600000
X-Envoy-Internal: true
X-Forwarded-For: 172.17.0.27, 172.17.0.10, 172.17.0.11
X-Forwarded-Proto: http
X-Request-Id: fd6d15cd-e281-94cf-961d-ab0fc70d7f1b

@lburgazzoli lburgazzoli self-assigned this Oct 27, 2019
lburgazzoli added a commit to lburgazzoli/apache-camel-k-runtime that referenced this issue Oct 27, 2019
@lburgazzoli
Copy link
Contributor

Should be fixed by #178.

lburgazzoli added a commit to lburgazzoli/apache-camel-k-runtime that referenced this issue Oct 27, 2019
lburgazzoli added a commit to lburgazzoli/apache-camel-k-runtime that referenced this issue Oct 27, 2019
lburgazzoli added a commit to lburgazzoli/apache-camel-k-runtime that referenced this issue Oct 27, 2019
@lburgazzoli
Copy link
Contributor

lburgazzoli commented Oct 27, 2019

The CamelCloudEvent* are helpers for user to avoid caring about the cloud event spec version but of course they are limited to the known attributes. CloudEvent headers have the precedence over CamelCloudEvent* so assuming a route using CloudEvent spec v0.3 like:

from("direct:start")
    .setHeader("ce-type")).constant("fromCEHeader")
    .setHeader("CamelCloudEventType").constant("fromCamelHeader")
    .to("knative:endpoint/ep");

The cloud event type will be set to fromCEHeader

Note that:

  • camel-knative producer does not generate structured content but always binary content whereas the consumer can handle both.
  • The headers CamelCloudEvent* on consumer side are added in addition to the CloudEvent header recevived by the consumer

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants