merlimat opened a new pull request, #25927: URL: https://github.com/apache/pulsar/pull/25927
### Motivation After the migration of `pulsar-client` to the V5 client API (#25917), the `consume` and `read` commands rejected `-st auto_consume` because the V5 client API had no generic-record representation. This restores `auto_consume` support by adding that representation to the V5 API. ### Modifications - **pulsar-client-api-v5**: new `GenericRecord` (a schema-less view over a decoded value), `Field` and `KeyValue` types, plus a `Schema.autoConsume()` factory. - **pulsar-client-v5**: `PulsarClientProviderV5.autoConsumeSchema()` wraps the genuine v4 `AUTO_CONSUME` schema so the v4 consumer still special-cases it for runtime schema fetching (`preProcessSchemaBeforeSubscribe` / `ConsumerImpl`). `MessageV5.value()` converts the decoded v4 `GenericRecord` into a v5 `GenericRecord` (`GenericRecordV5`), recursively for nested records and `KeyValue` native objects. - **pulsar-client-tools**: `CmdConsume`/`CmdRead` select `Schema.autoConsume()` for `-st auto_consume` instead of throwing; `AbstractCmdConsume` formats `GenericRecord` values (structured records, key/value, primitives) into a readable map. As a side benefit, the existing `Schema.generic(SchemaInfo)` now also surfaces a v5 `GenericRecord` from `Message.value()` instead of leaking a v4 one. ### Verifying this change - New unit tests in `SchemaFactoryTest`: the auto-consume schema unwraps to the genuine v4 `AutoConsumeSchema`, and the v4→v5 generic-record / key-value conversion is covered. - New end-to-end test `PulsarClientToolTest.testAutoConsumeSchema`: produces a JSON-schema message and consumes it via the CLI with `-st auto_consume`, asserting the decoded fields appear in the output. -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: [email protected] For queries about this service, please contact Infrastructure at: [email protected]
