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 2021/06/01 10:38:05 UTC

[GitHub] [pulsar] frank-montyne opened a new issue #10766: Subscribe consumer(Schema.STRING) with wildcard .+$ always fails with Incompatible schema: exists schema type AVRO, new schema type STRING

frank-montyne opened a new issue #10766:
URL: https://github.com/apache/pulsar/issues/10766


   **Describe the bug**
   I'm trying to subscribe to any persistent topic in a namespace. Suppose we have a a tenant 'aTenant' and a namespace 'aNamespace'. I subscribe to all topics:
   
   pulsarClient.newConsumer(Schema.STRING)
   	.subscriptionName("allTopics")
   	.subscriptionType(SubscriptionType.Exclusive)
   	.consumerName("consumerId")
   	.topic("persistent://aTenant/aNamespace/.+$")
   	.messageListener(messageListener)
   	.subscribe()); 
   The following exception is thrown:
   org.apache.pulsar.client.api.PulsarClientException$IncompatibleSchemaException: Incompatible schema: exists schema type AVRO, new schema type STRING
   	at org.apache.pulsar.client.api.PulsarClientException.unwrap(PulsarClientException.java:922)
   	at org.apache.pulsar.client.impl.ConsumerBuilderImpl.subscribe(ConsumerBuilderImpl.java:101)
   
   
   **To Reproduce**
   Steps to reproduce the behavior:
   Try the above
   
   **Expected behavior**
   No exception
   
   **Desktop (please complete the following information):**
    - OS: OSX, Linux
    - Pulsar 2.7.1, 2.7.2


-- 
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



[GitHub] [pulsar] gaozhangmin commented on issue #10766: Subscribe consumer(Schema.STRING) with wildcard .+$ always fails with Incompatible schema: exists schema type AVRO, new schema type STRING

Posted by GitBox <gi...@apache.org>.
gaozhangmin commented on issue #10766:
URL: https://github.com/apache/pulsar/issues/10766#issuecomment-857383073


   try this:
   ```
   Pattern allTopicsInNamespace = Pattern.compile("public/default/.*");
   Consumer allTopicsConsumer = consumerBuilder
           .topicsPattern(allTopicsInNamespace)
           .subscribe();
   ```


-- 
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



[GitHub] [pulsar] codelipenghui commented on issue #10766: Subscribe consumer(Schema.STRING) with wildcard .+$ always fails with Incompatible schema: exists schema type AVRO, new schema type STRING

Posted by GitBox <gi...@apache.org>.
codelipenghui commented on issue #10766:
URL: https://github.com/apache/pulsar/issues/10766#issuecomment-1058889806


   The issue had no activity for 30 days, mark with Stale label.


-- 
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