Skip to content

Commit

Permalink
fix class name's consistency.
Browse files Browse the repository at this point in the history
  • Loading branch information
thetumbled committed Mar 5, 2025
1 parent 9a047b8 commit dcdcb35
Show file tree
Hide file tree
Showing 7 changed files with 13 additions and 13 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -1059,7 +1059,7 @@ public void testDeadLetterTopicWithProducerBuilder() throws Exception {
final int sendMessages = 100;

// enable batch
ProducerBuilderCustomizer producerBuilderCustomizer = (context, producerBuilder) -> {
DeadLetterProducerBuilderCustomizer producerBuilderCustomizer = (context, producerBuilder) -> {
producerBuilder.enableBatching(true);
};
String subscriptionName = "my-subscription";
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -143,7 +143,7 @@ public void testRetryTopicWithProducerBuilder() throws Exception {
final int sendMessages = 100;

// enable batch
ProducerBuilderCustomizer producerBuilderCustomizer = (context, producerBuilder) -> {
DeadLetterProducerBuilderCustomizer producerBuilderCustomizer = (context, producerBuilder) -> {
producerBuilder.enableBatching(true);
};
String subscriptionName = "my-subscription";
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@ public class DeadLetterPolicy implements Serializable {
* can use the provided context (which includes input topic and subscription details) to adjust
* configurations such as timeouts, batching, or message routing.
*/
private ProducerBuilderCustomizer retryLetterProducerBuilderCustomizer;
private DeadLetterProducerBuilderCustomizer retryLetterProducerBuilderCustomizer;

/**
* Customizer for configuring the producer builder for the dead letter topic.
Expand All @@ -81,5 +81,5 @@ public class DeadLetterPolicy implements Serializable {
* implementations can perform specific adjustments that ensure the dead letter queue operates
* with the appropriate configurations tailored for handling undeliverable messages.
*/
private ProducerBuilderCustomizer deadLetterProducerBuilderCustomizer;
private DeadLetterProducerBuilderCustomizer deadLetterProducerBuilderCustomizer;
}
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@
* <p>This interface supplies relevant details such as the name of the input topic and associated subscription name.
* This contextual information helps in correctly configuring the producer for the appropriate topic.
*/
public interface ProducerBuilderContext {
public interface DeadLetterProducerBuilderContext {
/**
* Returns the default name of topic for the dead letter or retry letter producer. This topic name is used
* unless the ProducerBuilderCustomizer overrides it.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,14 +25,14 @@
* or the dead letter topic. The customization might include setting producer properties such as batching, timeouts,
* or any other producer-specific configuration.
*
* @see ProducerBuilderContext
* @see DeadLetterProducerBuilderContext
*/
public interface ProducerBuilderCustomizer {
public interface DeadLetterProducerBuilderCustomizer {
/**
* Customize the given producer builder with settings specific to the topic context provided.
*
* @param context the context containing information about the input topic and the subscription
* @param producerBuilder the producer builder instance to be customized
*/
void customize(ProducerBuilderContext context, ProducerBuilder<byte[]> producerBuilder);
void customize(DeadLetterProducerBuilderContext context, ProducerBuilder<byte[]> producerBuilder);
}
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,7 @@
import org.apache.pulsar.client.api.Messages;
import org.apache.pulsar.client.api.Producer;
import org.apache.pulsar.client.api.ProducerBuilder;
import org.apache.pulsar.client.api.ProducerBuilderContext;
import org.apache.pulsar.client.api.DeadLetterProducerBuilderContext;
import org.apache.pulsar.client.api.PulsarClientException;
import org.apache.pulsar.client.api.PulsarClientException.TopicDoesNotExistException;
import org.apache.pulsar.client.api.Schema;
Expand Down Expand Up @@ -2307,7 +2307,7 @@ private CompletableFuture<Producer<byte[]>> initDeadLetterProducerIfNeeded() {
.enableBatching(false)
.enableChunking(true);
if (deadLetterPolicy.getDeadLetterProducerBuilderCustomizer() != null) {
ProducerBuilderContext context = new ProducerBuilderContextImpl(
DeadLetterProducerBuilderContext context = new DeadLetterProducerBuilderContextImpl(
deadLetterPolicy.getDeadLetterTopic(), topic, subscription, consumerName);
deadLetterPolicy.getDeadLetterProducerBuilderCustomizer().customize(context, builder);
}
Expand Down Expand Up @@ -2378,7 +2378,7 @@ private CompletableFuture<Producer<byte[]>> initRetryLetterProducerIfNeeded() {
.enableChunking(true)
.blockIfQueueFull(false);
if (deadLetterPolicy.getRetryLetterProducerBuilderCustomizer() != null) {
ProducerBuilderContext context = new ProducerBuilderContextImpl(
DeadLetterProducerBuilderContext context = new DeadLetterProducerBuilderContextImpl(
deadLetterPolicy.getRetryLetterTopic(), topic, subscription, consumerName);
deadLetterPolicy.getRetryLetterProducerBuilderCustomizer().customize(context, builder);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,10 +19,10 @@
package org.apache.pulsar.client.impl;

import lombok.AllArgsConstructor;
import org.apache.pulsar.client.api.ProducerBuilderContext;
import org.apache.pulsar.client.api.DeadLetterProducerBuilderContext;

@AllArgsConstructor
class ProducerBuilderContextImpl implements ProducerBuilderContext {
class DeadLetterProducerBuilderContextImpl implements DeadLetterProducerBuilderContext {
private final String defaultTopicName;
private final String inputTopicName;
private final String inputTopicSubscriptionName;
Expand Down

0 comments on commit dcdcb35

Please sign in to comment.