streamnative / pulsar-archived

Apache Pulsar - distributed pub-sub messaging system
https://pulsar.apache.org
Apache License 2.0
72 stars 25 forks source link

ISSUE-10449: Topic auto creation won't create partitioned topics if client connects to discovery node. #2473

Open sijie opened 3 years ago

sijie commented 3 years ago

Original Issue: apache/pulsar#10449


Describe the bug

Configured the namespace to enable topic auto-creation, with partitioned topic type by default. If your consumer/producer are directly connected to broker, your topic will be created corrected with default number of partitions. If your consumer/producer are connected through the pulsar discovery node, then the topic is created as non-partitioned one.

To Reproduce Steps to reproduce the behavior:

  1. Setup your pulsar cluster with proxy in front of your brokers.
  2. Create a new namespace with the below configuration:
autoTopicCreationOverride:
  allowAutoTopicCreation: true
  topicType: partitioned
  defaultNumPartitions: 16
autoSubscriptionCreationOverride:
  allowAutoSubscriptionCreation: true
  1. Use either java/go client to connect to pulsar discovery node. Produce a message to a non-exist topic of that namespace.

Expected behavior A new topic created with 16 partitions

yangou commented 3 years ago

Tested on 2.7.2, still not fixed