{"record":{"id":"d477aa1c6c347709","repo":"risingwavelabs/risingwave","slug":"unsupported-encoding-for-maxwell","errorCode":null,"errorMessage":"unsupported encoding for Maxwell","messagePattern":"unsupported encoding for Maxwell","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"src/connector/src/parser/maxwell/maxwell_parser.rs","lineNumber":49,"sourceCode":"    source_ctx: SourceContextRef,\n}\n\nimpl MaxwellParser {\n    pub async fn new(\n        props: SpecificParserConfig,\n        rw_columns: Vec<SourceColumnDesc>,\n        source_ctx: SourceContextRef,\n    ) -> ConnectorResult<Self> {\n        match props.encoding_config {\n            EncodingProperties::Json(_) => {\n                let payload_builder = AccessBuilderImpl::new_default(props.encoding_config).await?;\n                Ok(Self {\n                    payload_builder,\n                    rw_columns,\n                    source_ctx,\n                })\n            }\n            _ => bail!(\"unsupported encoding for Maxwell\"),\n        }\n    }\n\n    pub async fn parse_inner(\n        &mut self,\n        payload: Vec<u8>,\n        mut writer: SourceStreamChunkRowWriter<'_>,\n    ) -> ConnectorResult<()> {\n        let m = writer.source_meta();\n        let payload_accessor = self.payload_builder.generate_accessor(payload, m).await?;\n        let row_op = MaxwellChangeEvent::new(payload_accessor);\n\n        apply_row_operation_on_stream_chunk_writer(row_op, &mut writer).map_err(Into::into)\n    }\n}\n\nimpl ByteStreamSourceParser for MaxwellParser {\n    fn columns(&self) -> &[SourceColumnDesc] {","sourceCodeStart":31,"sourceCodeEnd":67,"githubUrl":"https://github.com/risingwavelabs/risingwave/blob/6469eb736d691e8e9b8a419a57edd6429ca77417/src/connector/src/parser/maxwell/maxwell_parser.rs#L31-L67","documentation":"`MaxwellParser::new` only supports a specific set of encodings for the Maxwell CDC format; when the provided `EncodingProperties` variant falls through the match to the `_` arm, this error is raised. Maxwell messages are JSON-based, so encodings like Avro or Protobuf are rejected at parser construction.","triggerScenarios":"Constructing a Maxwell parser with `EncodingProperties` other than the supported JSON variants (e.g. Avro or Protobuf properties) via the parser dispatch when a source declares format=maxwell with a non-JSON encoding.","commonSituations":"Mixing connector options: setting format=maxwell but encoding=avro; copying an Avro-based Debezium source definition and only changing the format; internal dispatch building Maxwell parsers from the wrong encoding enum.","solutions":["Use JSON encoding with format=maxwell (remove or change the encoding option so it resolves to a supported Json properties variant).","Check the source's WITH options for an `encoding`/schema-registry setting that forces Avro; drop it for Maxwell.","If building parsers in code, verify the encoding enum passed to `MaxwellParser::new` matches one of the supported arms in the match."],"exampleFix":"// before\nlet props = EncodingProperties::Avro(avro_props);\nMaxwellParser::new(rw_columns, props, source_ctx).await?;\n// after\nlet props = EncodingProperties::Json(json_props);\nMaxwellParser::new(rw_columns, props, source_ctx).await?","handlingStrategy":"validation","validationCode":"if !matches!(encoding_props, EncodingProperties::Json(_)) {\n    return Err(anyhow!(\"Maxwell format only supports JSON encoding\"));\n}","typeGuard":"fn is_json_encoding(props: &EncodingProperties) -> bool { matches!(props, EncodingProperties::Json(_)) }","tryCatchPattern":null,"preventionTips":["Never set avro/protobuf encoding options together with format=maxwell.","Document and enforce the format-encoding compatibility matrix when wiring parsers."],"tags":["cdc","maxwell","encoding","config"],"backgroundTag":"unsupported-enum-value","analyzedSha":"6469eb736d691e8e9b8a419a57edd6429ca77417","analyzedAt":"2026-09-11T21:06:21.487Z","contentChangedAt":"2026-09-11T21:06:21.487Z","schemaVersion":2},"datasetVersion":"2026-09-14T16:17:12.679Z"}