Skip to content

backend: default cbor topicName to all topics - #2711

Open
RaphaelFakhri wants to merge 1 commit into
redpanda-data:masterfrom
RaphaelFakhri:fix/cbor-default-topic-name
Open

RaphaelFakhri wants to merge 1 commit into
redpanda-data:masterfrom
RaphaelFakhri:fix/cbor-default-topic-name

Conversation

@RaphaelFakhri

Copy link
Copy Markdown

What and why

serde.cbor.topicName is documented to default to /.*/, but Cbor.SetDefaults was empty and Serde.SetDefaults never called it. With serde.cbor.enabled: true and no topicName, the topic matcher stays empty. Picking CBOR as the key or value deserializer in the message viewer then fails on every topic.

This change sets the documented default and calls it from Serde.SetDefaults, the same way the MessagePack config does. A configured topicName (literal or /regex/) still replaces the default, and a test covers both cases.

Fixes #2487

Examples

Config:

serde:
  cbor:
    enabled: true

Before: picking CBOR as the value deserializer shows cbor encoding not configured for topic: <topic>.

After: records on any topic decode as CBOR. go test -run TestSerde_ ./pkg/config/ fails on master (expected cbor topicName to default to a regex) and passes with this change.

The cbor.topicName config documents a default of /.*/, but Cbor had
an empty SetDefaults and Serde.SetDefaults never called it. With CBOR
enabled and no topicName set, the topic matcher was empty, so picking
CBOR as the key or value deserializer in the message viewer failed
with "cbor encoding not configured for topic" on every topic.

Set the documented default and call it from Serde.SetDefaults, as
the MessagePack config already does. A configured topicName still
replaces the default.

Fixes redpanda-data#2487
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 this pull request may close these issues.

No default topicName for serde CBOR

1 participant