Class JsonMessageBatch
- java.lang.Object
-
- pl.allegro.tech.hermes.consumers.consumer.batch.JsonMessageBatch
-
- All Implemented Interfaces:
MessageBatch
@NotThreadSafe public class JsonMessageBatch extends java.lang.Object implements MessageBatch
-
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidappend(byte[] data, pl.allegro.tech.hermes.tracker.consumers.MessageMetadata metadata)booleancanFit(byte[] data)MessageBatchclose()java.util.List<pl.allegro.tech.hermes.api.Header>getAdditionalHeaders()intgetCapacity()java.nio.ByteBuffergetContent()pl.allegro.tech.hermes.api.ContentTypegetContentType()java.lang.StringgetId()longgetLifetime()java.util.List<pl.allegro.tech.hermes.tracker.consumers.MessageMetadata>getMessagesMetadata()java.util.List<SubscriptionPartitionOffset>getPartitionOffsets()intgetRetryCounter()pl.allegro.tech.hermes.api.SubscriptionNamegetSubscription()java.lang.StringgetTopic()booleanhasSubscriptionIdentityHeaders()voidincrementRetryCounter()booleanisBiggerThanTotalCapacity(byte[] data)booleanisClosed()booleanisEmpty()booleanisExpired()booleanisFull()intsize()-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface pl.allegro.tech.hermes.consumers.consumer.batch.MessageBatch
isReadyForDelivery
-
-
-
-
Method Detail
-
isFull
public boolean isFull()
- Specified by:
isFullin interfaceMessageBatch
-
append
public void append(byte[] data, pl.allegro.tech.hermes.tracker.consumers.MessageMetadata metadata)- Specified by:
appendin interfaceMessageBatch
-
canFit
public boolean canFit(byte[] data)
- Specified by:
canFitin interfaceMessageBatch
-
isExpired
public boolean isExpired()
- Specified by:
isExpiredin interfaceMessageBatch
-
getId
public java.lang.String getId()
- Specified by:
getIdin interfaceMessageBatch
-
getContentType
public pl.allegro.tech.hermes.api.ContentType getContentType()
- Specified by:
getContentTypein interfaceMessageBatch
-
close
public MessageBatch close()
- Specified by:
closein interfaceMessageBatch
-
getContent
public java.nio.ByteBuffer getContent()
- Specified by:
getContentin interfaceMessageBatch
-
getPartitionOffsets
public java.util.List<SubscriptionPartitionOffset> getPartitionOffsets()
- Specified by:
getPartitionOffsetsin interfaceMessageBatch
-
getMessagesMetadata
public java.util.List<pl.allegro.tech.hermes.tracker.consumers.MessageMetadata> getMessagesMetadata()
- Specified by:
getMessagesMetadatain interfaceMessageBatch
-
getAdditionalHeaders
public java.util.List<pl.allegro.tech.hermes.api.Header> getAdditionalHeaders()
- Specified by:
getAdditionalHeadersin interfaceMessageBatch
-
size
public int size()
- Specified by:
sizein interfaceMessageBatch
-
getLifetime
public long getLifetime()
- Specified by:
getLifetimein interfaceMessageBatch
-
isClosed
public boolean isClosed()
- Specified by:
isClosedin interfaceMessageBatch
-
isEmpty
public boolean isEmpty()
- Specified by:
isEmptyin interfaceMessageBatch
-
isBiggerThanTotalCapacity
public boolean isBiggerThanTotalCapacity(byte[] data)
- Specified by:
isBiggerThanTotalCapacityin interfaceMessageBatch
-
getCapacity
public int getCapacity()
- Specified by:
getCapacityin interfaceMessageBatch
-
incrementRetryCounter
public void incrementRetryCounter()
- Specified by:
incrementRetryCounterin interfaceMessageBatch
-
getRetryCounter
public int getRetryCounter()
- Specified by:
getRetryCounterin interfaceMessageBatch
-
hasSubscriptionIdentityHeaders
public boolean hasSubscriptionIdentityHeaders()
- Specified by:
hasSubscriptionIdentityHeadersin interfaceMessageBatch
-
getTopic
public java.lang.String getTopic()
- Specified by:
getTopicin interfaceMessageBatch
-
getSubscription
public pl.allegro.tech.hermes.api.SubscriptionName getSubscription()
- Specified by:
getSubscriptionin interfaceMessageBatch
-
-