codelipenghui commented on code in PR #17449:
URL: https://github.com/apache/pulsar/pull/17449#discussion_r1053215124
##########
pulsar-broker/src/main/java/org/apache/pulsar/broker/service/persistent/PersistentTopic.java:
##########
@@ -808,7 +811,8 @@ private CompletableFuture<Consumer> internalSubscribe(final
TransportCnx cnx, St
CompletableFuture<Consumer> future =
subscriptionFuture.thenCompose(subscription -> {
Consumer consumer = new Consumer(subscription, subType, topic,
consumerId, priorityLevel,
consumerName, isDurable, cnx, cnx.getAuthRole(),
metadata,
- readCompacted, keySharedMeta, startMessageId,
consumerEpoch);
+ readCompacted, keySharedMeta, startMessageId,
consumerEpoch,
+ schemaData == null ? SchemaType.AUTO_CONSUME :
schemaData.getType());
Review Comment:
Null `schemaData` can also represent BYTES schema. After this change, it
will not only fix the auto_consume schema issue. It also changed the behavior
of the BYTES schema.
Before, if there were consumers with BYTES schema, only the consumer with
BYTES schema could subscribe to the topic. With this fix, the consumer with
Avro schema can also subscribe to this topic, right?
Looks like we are not able to fix the problem without client-side changes.
##########
pulsar-broker/src/main/java/org/apache/pulsar/broker/service/Consumer.java:
##########
@@ -142,11 +143,13 @@ public class Consumer {
private long negtiveUnackedMsgsTimestamp;
+ private SchemaType schemaType;
Review Comment:
```suggestion
private final SchemaType schemaType;
```
--
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]