pl.allegro.tech.hermes.consumers.consumer.batch.MessageBatch 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.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