pl.allegro.tech.hermes.consumers.consumer.sender.googlepubsub.GooglePubSubMetadataCompressionAppender Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of hermes-consumers Show documentation
Show all versions of hermes-consumers Show documentation
Fast and reliable message broker built on top of Kafka.
package pl.allegro.tech.hermes.consumers.consumer.sender.googlepubsub;
import pl.allegro.tech.hermes.consumers.consumer.Message;
import java.util.Map;
class GooglePubSubMetadataCompressionAppender extends GooglePubSubMetadataAppender {
public static final String HEADER_NAME_CODEC_NAME = "cn";
private final String codecHeader;
GooglePubSubMetadataCompressionAppender(CompressionCodec codec) {
this.codecHeader = codec.getHeader();
}
@Override
protected Map createMessageAttributes(Message message) {
Map messageAttributes = super.createMessageAttributes(message);
messageAttributes.put(HEADER_NAME_CODEC_NAME, codecHeader);
return messageAttributes;
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy