Skip to content

IntegrationSink SNS converts and publishes messages in a non-standard format #8744

@darkgnotic

Description

@darkgnotic

Describe the bug

(I am not 100% where the bug is happening, so apologies if this is a configuration error on my part)

When sending events through the IntegrationSink SNS option, the topic's Message field appears to be formatted in a non-JSON object format (e.g. with '=' as the key/value delimiter):

{
  "Type": "Notification",
  "MessageId": "70f6a303-3572-56c0-adba-c25935d9a107",
  "TopicArn": "arn:aws:sns:us-east-1:...",
  "Subject": "/apis/v1/namespaces/foo/pods/bar",
  "Message": "{apiVersion=v1, kind=Pod, metadata={creationTimestamp=2025-10-03T02:37:45Z, generateName=...",
  ...
}

The IntegrationSink Log option, however, correctly outputs JSON bodies:

Body: {"apiVersion":"v1","kind":"Pod","metadata":{"creationTimestamp":"2025-10-03T02:37:45Z","generateName":"..."}

I am also able to reproduce this with events from my application, so it is not limited to events from the ApiServerSource:

SNS sink:

{
  "Type": "Notification",
  "MessageId": "e770e27c-04b1-5345-8a0b-83253ed340c8",
  "TopicArn": "arn:aws:sns:us-east-1:...",
  "Message": "{type=zero/events/status/replication/v1, component=replication, status=OK, stage=Indexing, description=Creating 22 indexes, time=2025-10-03T02:42:37.592Z, ..."

Log sink:

Body: {"type":"zero/events/status/replication/v1","component":"replication","status":"OK","stage":"Indexing","description":"Creating 22 indexes","time":"2025-10-03T02:42:37.592Z", ...}

--

Expected behavior

The Message that the SNS option publishes to the Topic should be the same data and format that it received.

To Reproduce

I am able to reproduce this with the built in ApiServerSource as well as with custom CloudEvents.

Knative release version

I'm using knative-eventing v1.19.0

Additional context

It's possible that it is related to the Kamlet setup, similar to (and perhaps even fixed by?) knative-extensions/eventing-integrations#103.

This is just a guess though ... I have not studied the code well enough to make a better diagnosis.

Your help is appreciated! 🙏

Metadata

Metadata

Assignees

No one assigned

    Labels

    kind/bugCategorizes issue or PR as related to a bug.

    Type

    No type

    Projects

    Status

    Backlog

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions