Skip to content

[Bug] Pulsar Functions ignores compressionType and crypto config for producers created with Context produce/newOutputMessage methods #22948

@lhotari

Description

@lhotari

Search before asking

  • I searched in the issues and found nothing similar.

Read release policy

  • I understand that unsupported versions don't get bug fixes. I will attempt to reproduce the issue on a supported version of Pulsar client and Pulsar broker.

Version

any released version

Minimal reproduce step

What did you expect to see?

I'd expect that the configured compression type would be used.
compression type is handled in the other location where Pulsar Sources create producers:

if (producerConfig.getCompressionType() != null) {
builder.compressionType(producerConfig.getCompressionType());
} else {
builder.compressionType(CompressionType.LZ4);
}

crypto config is handled for Pulsar Sources:

if (producerConfig.getCryptoConfig() != null) {
builder.cryptoKeyReader(crypto.keyReader);
builder.cryptoFailureAction(crypto.failureAction);
for (String encryptionKeyName : crypto.getEncryptionKeys()) {
builder.addEncryptionKey(encryptionKeyName);
}
}

What did you see instead?

compression type is hard coded to LZ4:


There's no crypto config configuration.

Anything else?

Code to create producers shouldn't be duplicated in Pulsar Functions since it leads to inconsistencies.

Are you willing to submit a PR?

  • I'm willing to submit a PR!

Metadata

Metadata

Assignees

Labels

type/bugThe PR fixed a bug or issue reported a bug

Type

No type
No fields configured for issues without a type.

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions