All Downloads are FREE. Search and download functionalities are using the official Maven repository.

pl.allegro.tech.hermes.consumers.consumer.sender.googlepubsub.GooglePubSubMetadataCompressionAppender Maven / Gradle / Ivy

There is a newer version: 2.8.0
Show newest version
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