zzzming commented on code in PR #809:
URL: https://github.com/apache/pulsar-client-go/pull/809#discussion_r923525578
##########
pulsar/dlq_router.go:
##########
@@ -135,12 +135,16 @@ func (r *dlqRouter) getProducer(schema Schema) Producer {
// Retry to create producer indefinitely
backoff := &internal.Backoff{}
for {
- producer, err := r.client.CreateProducer(ProducerOptions{
- Topic: r.policy.DeadLetterTopic,
- CompressionType: LZ4,
- BatchingMaxPublishDelay: 100 * time.Millisecond,
- Schema: schema,
- })
+ opt := r.policy.DLQProducerOptions
+ opt.Topic = r.policy.DeadLetterTopic
+ opt.Schema = schema
+
+ // the origin code sets to LZ4 compression with no options
+ // so the new design allows compression type to be overwritten
but still set lz4 by default
+ if r.policy.DLQProducerOptions.CompressionType == NoCompression
{
Review Comment:
The current implementation complies with the default LZ4 compression type in
the previous implementation. So user cannot choose NoCompression. If
NoCompression is required (I would prefer data has to be sent compressed as the
original design), we might have to introduce another option to maintain
backward compatibility.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]