If I have a topic called var test = "test"
and I create a bean:
@Bean(name = "test")
public Producer<Test> testProducer(PulsarClient pulsarClient){
return pulsarClient.newProducer()
.topic(test)
.create();
}
The topic is created I want to partition, how?
To create a topic with partitions you can either configure the following settings for the Pulsar Broker (if you are relying on automatic topic creation)
Alternatively you can use the Pulsar Admin and use
createPartitionedTopic
https://github.com/apache/pulsar/blob/a165bda1d03e370f5efe1173134fb94e12b584b5/pulsar-client-admin-api/src/main/java/org/apache/pulsar/client/admin/Topics.java#L473-L475However once a topic has been created (I assume non-partitioned) then there is no way to make it partitioned. It has to be partitioned at topic creation time.