IntegrationSink SNS messages are missing core Cloud Event attributes
- Dominant language
- Go
- Stars
- 1.6k
- Forks
- 631
- Avg merge
- 2d 1h
- Merged PRs (30d)
- 6
Description
**Describe the bug**
SNS messages created by the IntegrationSink (sns option) are missing core Cloud Event attributes (`id`, `type`, `subject`, `time`, etc.). Extension attributes, on the other hand, are preserved.
**Expected behavior**
The MessageAttributes of the produced SNS message should contain all Cloud Event attributes.
**To Reproduce**
Use the IntegrationSink with the `sns` option.
**Knative release version**
v0.19.0
**Additional context**
The HTTP headers by default have the `CamelCloudEvent` prefix for core attributes, and the `Ce-` prefix for extension attributes, e.g.
```
CamelCloudEventID=2d07a084-e0d0-4bc9-9724-8bcff8360f5a
CamelCloudEventSource=https://10.100.0.1:443
CamelCloudEventSubject=/apis/apps/v1/namespaces/foo/deployments/bar
CamelCloudEventTime=2025-09-15T15:20:30.182762705Z
CamelCloudEventType=dev.knative.apiserver.resource.delete
CamelCloudEventVersion=1.0
CamelHttpMethod=POST
CamelHttpPath=
CamelHttpQuery=null
CamelHttpUri=/
Ce-Apiversion=apps/v1
Ce-Kind=Deployment
Ce-Knativearrivaltime=2025-09-15T15:20:30.183022734Z
Ce-Name=bar
Ce-Namespace=foo
Content-Length=10929
Content-Type=application/json
Host=cluster-events-log-sink-service.events.svc.cluster.local
Kn-Namespace=events
Prefer=reply
User-Agent=Go-http-client/1.1
```
The `apiversion`, `kind`, `knativearrivaltime`, `name`, and `namespace` extension attributes all appear the SNS MessageAttributes, but the `id`, `source`, `subject`, `time`, and `type` do not.
I believe the core attributes are filtered because the [Sns2HeaderFilterStrategy](https://github.com/apache/camel/blob/b4f6578658e48a56d61ae5f847ca9a558ee0f54e/components/camel-aws/camel-aws2-sns/src/main/java/org/apache/camel/component/aws2/sns/Sns2HeaderFilterStrategy.java#L29) filters out any headers that start with `Camel`, which includes not only internal headers like the CamelHttp* headers, but the CamelCloudEvent* headers as well.
It's possible that the sink needs to be configured with a [CloudEventHttpDataTypeTransformer](https://github.com/apache/camel/blob/b4f6578658e48a56d61ae5f847ca9a558ee0f54e/components/camel-cloudevents/src/main/java/org/apache/camel/component/cloudevents/transformer/CloudEventHttpDataTypeTransformer.java#L53) to convert those header names to their `ce-*` equivalents before being handed off to the SNS logic, but I have not studied the code enough to be 100% sure.
Contributor guide
Research direction
Start by tracing the IntegrationSink `sns` option and compare its handling with Apache Camel's `Sns2HeaderFilterStrategy.java` and `CloudEventHttpDataTypeTransformer.java`, which the issue links. Reproduce the sink flow and inspect the SNS MessageAttributes; done means the core Cloud Event attributes and existing extension attributes are preserved.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- aws, go, java
- Domain
- api, backend, cloud
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 38/100