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 2019/07/31 23:58:39 UTC

[GitHub] [pulsar] sijie commented on issue #4857: Error: "Trying to subscribe with incompatible schema" even though isSchemaValidationEnforced=false

sijie commented on issue #4857: Error: "Trying to subscribe with incompatible schema" even though isSchemaValidationEnforced=false 
URL: https://github.com/apache/pulsar/issues/4857#issuecomment-517065570
 
 
   @devinbost 
   
   I think `isSchemaValidationEnforced` is only applied for producers without schema connecting to a topic with schema. We introduced this setting to allow non-java clients (without schema support) still being able to produce messages to the topic.
   
   The error you described is a subscription error. It means a consumer with schema attempts to consume messages from a topic without schema.
   
   In your case,
   
   - the Kafka source is transferring bytes from a Kafka topic to a Pulsar topic. It will create a pulsar topic `persistent://example-tenant/ingest/example-kafka-topic` without schema.
   - The function is consuming from the Pulsar topic `persistent://example-tenant/ingest/example-kafka-topic` with a string schema. (because the schema is inferred from the function input type).
   
   Hence the function will fail to start because the function attempts to consume `persistent://example-tenant/ingest/example-kafka-topic` with a string schema.
   
   ---
   
   There are a few workarounds:
   
   1) you can precreate the topic with `String` schema. so that Kafka source is able to produce with `isSchemaValidationEnforced` setting to true.
   
   2) you can disable schema compatibility check by setting the namespace's schema compatibility check policy to `None`: `bin/pulsar-admin namespaces set-schema-autoupdate-strategy -d tenant/namespace`.
   
   ---
   
   We can also consider extending `isSchemaValidationEnforced` for disabling schema validation completely.

----------------------------------------------------------------
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.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


With regards,
Apache Git Services