You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@pulsar.apache.org by GitBox <gi...@apache.org> on 2022/12/12 04:36:28 UTC

[GitHub] [pulsar] congbobo184 commented on a diff in pull request #17449: [fix][broker]Fix using schema to create consumer fails after using AUTO_CONSUME consumer to subscribe topic

congbobo184 commented on code in PR #17449:
URL: https://github.com/apache/pulsar/pull/17449#discussion_r1045395835


##########
pulsar-broker/src/main/java/org/apache/pulsar/broker/service/ServerCnx.java:
##########
@@ -1113,11 +1113,12 @@ protected void handleSubscribe(final CommandSubscribe subscribe) {
                                     .subscriptionProperties(subscriptionProperties)
                                     .consumerEpoch(consumerEpoch)
                                     .build();
-                            if (schema != null) {
-                                return topic.addSchemaIfIdleOrCheckCompatible(schema)
-                                        .thenCompose(v -> topic.subscribe(option));
+                            if (schema != null && schema.getType() != SchemaType.AUTO_PUBLISH
+                                    && schema.getType() != SchemaType.AUTO_CONSUME) {

Review Comment:
   if the client consumer sub with Schema.Type AUTO_CONSUME, the sub command arrived at the broker, the schema is null. we don't need to check this, because schema.getType() != SchemaType.AUTO_CONSUME always true



-- 
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: commits-unsubscribe@pulsar.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org