Skip to content

Commit 0f202b5

Browse files
committed
Make initialSubscriptionName internal.
Signed-off-by: Zike Yang <[email protected]>
1 parent 21dd95b commit 0f202b5

File tree

3 files changed

+15
-16
lines changed

3 files changed

+15
-16
lines changed

pulsar-client-api/src/main/java/org/apache/pulsar/client/api/ProducerBuilder.java

Lines changed: 0 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -596,13 +596,4 @@ public interface ProducerBuilder<T> extends Cloneable {
596596
* @return the producer builder instance
597597
*/
598598
ProducerBuilder<T> enableLazyStartPartitionedProducers(boolean lazyStartPartitionedProducers);
599-
600-
/**
601-
* Use this config to automatically create an initial subscription when creating the topic.
602-
* If this field is not set, the initial subscription will not be created.
603-
*
604-
* @param initialSubscriptionName Name of the initial subscription of the topic.
605-
* @return the producer builder instance
606-
*/
607-
ProducerBuilder<T> initialSubscriptionName(String initialSubscriptionName);
608599
}

pulsar-client/src/main/java/org/apache/pulsar/client/impl/ConsumerImpl.java

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1871,11 +1871,12 @@ private void initDeadLetterProducerIfNeeded() {
18711871
createProducerLock.writeLock().lock();
18721872
try {
18731873
if (deadLetterProducer == null) {
1874-
deadLetterProducer = client.newProducer(Schema.AUTO_PRODUCE_BYTES(schema))
1875-
.topic(this.deadLetterPolicy.getDeadLetterTopic())
1876-
.blockIfQueueFull(false)
1877-
.initialSubscriptionName(this.deadLetterPolicy.getInitSubscriptionName())
1878-
.createAsync();
1874+
deadLetterProducer =
1875+
((ProducerBuilderImpl<byte[]>) client.newProducer(Schema.AUTO_PRODUCE_BYTES(schema)))
1876+
.initialSubscriptionName(this.deadLetterPolicy.getInitSubscriptionName())
1877+
.topic(this.deadLetterPolicy.getDeadLetterTopic())
1878+
.blockIfQueueFull(false)
1879+
.createAsync();
18791880
}
18801881
} finally {
18811882
createProducerLock.writeLock().unlock();

pulsar-client/src/main/java/org/apache/pulsar/client/impl/ProducerBuilderImpl.java

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -329,8 +329,15 @@ public ProducerBuilder<T> enableLazyStartPartitionedProducers(boolean lazyStartP
329329
return this;
330330
}
331331

332-
@Override
333-
public ProducerBuilder<T> initialSubscriptionName(String initialSubscriptionName) {
332+
/**
333+
* Use this config to automatically create an initial subscription when creating the topic.
334+
* If this field is not set, the initial subscription will not be created.
335+
* This method is limited to internal use
336+
*
337+
* @param initialSubscriptionName Name of the initial subscription of the topic.
338+
* @return the producer builder implementation instance
339+
*/
340+
public ProducerBuilderImpl<T> initialSubscriptionName(String initialSubscriptionName) {
334341
conf.setInitialSubscriptionName(initialSubscriptionName);
335342
return this;
336343
}

0 commit comments

Comments
 (0)