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

pl.allegro.tech.hermes.consumers.consumer.batch.MessageBatch Maven / Gradle / Ivy

There is a newer version: 2.8.0
Show newest version
package pl.allegro.tech.hermes.consumers.consumer.batch;

import pl.allegro.tech.hermes.api.ContentType;
import pl.allegro.tech.hermes.api.Header;
import pl.allegro.tech.hermes.api.SubscriptionName;
import pl.allegro.tech.hermes.consumers.consumer.offset.SubscriptionPartitionOffset;
import pl.allegro.tech.hermes.tracker.consumers.MessageMetadata;

import java.nio.BufferOverflowException;
import java.nio.ByteBuffer;
import java.util.List;

public interface MessageBatch {

    default boolean isReadyForDelivery() {
        return isClosed() || isFull() || isExpired();
    }

    void append(byte[] data, MessageMetadata batchMessageMetadata) throws BufferOverflowException;

    boolean canFit(byte[] data);

    boolean isExpired();

    boolean isClosed();

    boolean isFull();

    String getId();

    ContentType getContentType();

    ByteBuffer getContent();

    List getPartitionOffsets();

    List getMessagesMetadata();

    List
getAdditionalHeaders(); long getLifetime(); int getMessageCount(); MessageBatch close(); boolean isEmpty(); boolean isBiggerThanTotalCapacity(byte[] data); int getCapacity(); int getSize(); void incrementRetryCounter(); int getRetryCounter(); boolean hasSubscriptionIdentityHeaders(); String getTopic(); SubscriptionName getSubscription(); }




© 2015 - 2025 Weber Informatics LLC | Privacy Policy