Skip to content

CloudEventMessageBuilder creates URI with surrounding quotes #3055

@kschlesselmann

Description

@kschlesselmann

Currently we're migrating some of our messages to Cloud Events. If we use

CloudEventMessageBuilder.withData(this)
        .setId(UUID.randomUUID().toString())
        .setSource("/my/source")
        .setSpecVersion("1.0")
        .setType("my.type")
        .setHeader(KafkaHeaders.KEY, myId)
        .build(CloudEventMessageUtils.KAFKA_ATTR_PREFIX)

the resulting message apparently has a header ce_source="/my/source" and other clients which validate the incoming messages fail with "/my/source" not being a valid URI.

If I just set the header myself using .setHeader(CloudEventMessageUtils.SOURCE, "/my/source") everything seems fine.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions