use of com.yahoo.pulsar.client.impl.PartitionedProducerImpl in project pulsar by yahoo.
the class PartitionedProducerConsumerTest method testDeletePartitionedTopic.
@Test
public void testDeletePartitionedTopic() throws Exception {
int numPartitions = 4;
DestinationName dn = DestinationName.get("persistent://my-property/use/my-ns/my-partitionedtopic6");
admin.persistentTopics().createPartitionedTopic(dn.toString(), numPartitions);
Producer producer = pulsarClient.createProducer(dn.toString());
Consumer consumer = pulsarClient.subscribe(dn.toString(), "my-sub");
consumer.unsubscribe();
consumer.close();
producer.close();
admin.persistentTopics().deletePartitionedTopic(dn.toString());
Producer producer1 = pulsarClient.createProducer(dn.toString());
if (producer1 instanceof PartitionedProducerImpl) {
Assert.fail("should fail since partitioned topic was deleted");
}
}
Aggregations