File tree Expand file tree Collapse file tree 3 files changed +15
-16
lines changed
pulsar-client-api/src/main/java/org/apache/pulsar/client/api
pulsar-client/src/main/java/org/apache/pulsar/client/impl Expand file tree Collapse file tree 3 files changed +15
-16
lines changed Original file line number Diff line number Diff 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}
Original file line number Diff line number Diff 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 ();
Original file line number Diff line number Diff 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 }
You can’t perform that action at this time.
0 commit comments