Skip to content

Receiving a JSON pubsub event #1119

@oliver-anz

Description

@oliver-anz

Hi

My use case is that I'm trying to pipe proto cloud events from one pubsub topic, convert them to json using redpanda's to_json processor and then push them to a second pubsub topic. This works fine. When I try to set the ce-datacontenttype to application/json however, I find that it sometimes reverts back to application/protobuf

Reading through the code, it seems that I might need to set "Content-Type" to "application/cloudevents+json". However, when I do this, it fails at this line, which seems to indicate that if the ce-specversion attribute is present then the pubsub message can't be read/received as structured. When I remove the ce-specversion attribute, I then get an error at this line.

What's going on here? Just want to convert a pubsub cloud event to a json cloud event.

Any help or guidance that can be provided would be greatly appreciated.
Thanks!

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions