Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[improve] [pip] PIP-316 Create a producerName field for DeadLetterPolicy #21507

Closed
wants to merge 1 commit into from
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
83 changes: 83 additions & 0 deletions pip/pip-316.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,83 @@

# PIP-316: Create a producerName field for DeadLetterPolicy


# Motivation

Add producerName for dead letter producer, easier to locate problems.
RobertIndie marked this conversation as resolved.
Show resolved Hide resolved


# Goals

## In Scope

Add a new field `producerName` in `org.apache.pulsar.client.api.DeadLetterPolicy` class.


## Out of Scope
None.

# High Level Design

If `producerName` is not empty, use `producerName` as the name of the dead letter producer.
crossoverJie marked this conversation as resolved.
Show resolved Hide resolved


# Detailed Design

## Design & Implementation Details

Specify `producerName` in the `org.apache.pulsar.client.impl.ConsumerImpl.initDeadLetterProducerIfNeeded` method:

```java
ProducerBuilder<byte[]> producerBuilder = ((ProducerBuilderImpl<byte[]>)
client.newProducer(Schema.AUTO_PRODUCE_BYTES(schema)))
.initialSubscriptionName(this.deadLetterPolicy.getInitialSubscriptionName())
.topic(this.deadLetterPolicy.getDeadLetterTopic())
.blockIfQueueFull(false)
.enableBatching(false)
.enableChunking(true);
if (StringUtils.isNotBlank(conf.getDeadLetterPolicy().getProducerName())) {
producerBuilder.producerName(conf.getDeadLetterPolicy().getProducerName());
}
deadLetterProducer = producerBuilder.createAsync();
```






## Public-facing Changes

### Public API


### Binary protocol

### Configuration

### CLI

### Metrics


# Monitoring

# Security Considerations

# Backward & Forward Compatibility

## Revert


## Upgrade


# Alternatives

# General Notes

# Links

* Mailing List discussion thread:
* Mailing List voting thread: