Class ClientLargeMessageImpl
java.lang.Object
org.apache.activemq.artemis.api.core.RefCountMessage
org.apache.activemq.artemis.core.message.impl.CoreMessage
org.apache.activemq.artemis.core.client.impl.ClientMessageImpl
org.apache.activemq.artemis.core.client.impl.ClientLargeMessageImpl
- All Implemented Interfaces:
ClientMessage,ICoreMessage,Message,ClientLargeMessageInternal,ClientMessageInternal
public final class ClientLargeMessageImpl
extends ClientMessageImpl
implements ClientLargeMessageInternal
ClientLargeMessageImpl is only created when receiving large messages.
At the time of sending a regular Message is sent as we won't know the message is considered large until the buffer is filled up or the user set a streaming.
-
Field Summary
Fields inherited from class org.apache.activemq.artemis.core.client.impl.ClientMessageImpl
REPLYTO_HEADER_NAMEFields inherited from class org.apache.activemq.artemis.core.message.impl.CoreMessage
address, BODY_OFFSET, buffer, BUFFER_HEADER_SPACE, durable, endOfBodyPosition, memoryEstimate, messageID, messageIDPosition, paged, priority, properties, timestamp, type, writableBufferFields inherited from interface org.apache.activemq.artemis.api.core.Message
AMQP_PROPERTY_PREDICATE, BYTES_TYPE, DEFAULT_TYPE, EMBEDDED_TYPE, HDR_ACTUAL_EXPIRY_TIME, HDR_BRIDGE_DUPLICATE_ID, HDR_CONTENT_TYPE, HDR_DUPLICATE_DETECTION_ID, HDR_GROUP_ID, HDR_GROUP_SEQUENCE, HDR_INGRESS_TIMESTAMP, HDR_LARGE_BODY_SIZE, HDR_LARGE_COMPRESSED, HDR_LAST_VALUE_NAME, HDR_ORIG_MESSAGE_ID, HDR_ORIG_ROUTING_TYPE, HDR_ORIGINAL_ADDRESS, HDR_ORIGINAL_QUEUE, HDR_PREFIX, HDR_ROUTE_TO_ACK_IDS, HDR_ROUTE_TO_IDS, HDR_ROUTING_TYPE, HDR_SCALEDOWN_TO_IDS, HDR_SCHEDULED_DELIVERY_TIME, HDR_VALIDATED_USER, INTERNAL_PROPERTY_NAMES_PREDICATE, LARGE_EMBEDDED_TYPE, MAP_TYPE, memoryOffset, OBJECT_TYPE, PREFIX_AMQP_ANNOTATIONS, STREAM_TYPE, TEXT_TYPE -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidThis can be optionally used to verify if the entire message has been received.voidThe buffer to write the body.intReturns the size (in bytes) of this message's body.intReturns the size of the encoded message.longbooleanvoidretrieveExistingData(ClientMessageInternal clMessage) voidSaves the content of the message to the OutputStream.voidsetLargeMessageController(LargeMessageController controller) voidsetLargeMessageSize(long largeMessageSize) Sets the OutputStream that will receive the content of a message received in a non blocking way.booleanwaitOutputStreamCompletion(long timeMilliseconds) Wait the outputStream completion of the message.Methods inherited from class org.apache.activemq.artemis.core.client.impl.ClientMessageImpl
acknowledge, copy, getBodyInputStream, getDeliveryCount, getFlowControlSize, getLargeBodyReader, individualAcknowledge, isCompressed, isConfirmed, onReceipt, putBooleanProperty, putBooleanProperty, putByteProperty, putByteProperty, putBytesProperty, putBytesProperty, putCharProperty, putCharProperty, putDoubleProperty, putDoubleProperty, putFloatProperty, putFloatProperty, putIntProperty, putIntProperty, putLongProperty, putLongProperty, putObjectProperty, putObjectProperty, putShortProperty, putShortProperty, putStringProperty, putStringProperty, putStringProperty, setBodyInputStream, setConfirmed, setDeliveryCount, setDurable, setExpiration, setFlowControlSize, setPriority, setUserID, toString, writeBodyBufferBytes, writeBodyBufferStringMethods inherited from class org.apache.activemq.artemis.core.message.impl.CoreMessage
checkEncode, clearAMQPProperties, clearInternalProperties, containsProperty, containsProperty, copy, decodeHeadersAndProperties, encode, encodeHeadersAndProperties, getAddress, getAddressSimpleString, getAnnotation, getBodyBufferSize, getBooleanProperty, getBooleanProperty, getBuffer, getByteProperty, getByteProperty, getBytesProperty, getBytesProperty, getCorrelationID, getDataBuffer, getDoubleProperty, getDoubleProperty, getDuplicateProperty, getEndOfBodyPosition, getExpiration, getFloatProperty, getFloatProperty, getGroupID, getGroupSequence, getHeadersAndPropertiesEncodeSize, getIntProperty, getIntProperty, getLastValueProperty, getLongProperty, getLongProperty, getMemoryEstimate, getMessageID, getObjectProperty, getObjectProperty, getOwner, getPersistentSize, getPersister, getPersistSize, getPriority, getProperties, getPropertyNames, getProtocolName, getReadOnlyBodyBuffer, getReplyTo, getRoutingType, getScheduledDeliveryTime, getShortProperty, getShortProperty, getSimpleStringProperty, getSimpleStringProperty, getStringBody, getStringProperty, getStringProperty, getTimestamp, getType, getUserID, getValidatedUserID, hasScheduledDeliveryTime, initBuffer, internalSetMessageID, isDurable, isPaged, isServerMessage, messageChanged, moveHeadersAndProperties, persist, receiveBuffer, receiveBuffer_1X, reloadPersistence, removeAnnotation, removeProperty, removeProperty, searchProperty, sendBuffer, sendBuffer_1X, setAddress, setAddress, setBuffer, setCorrelationID, setGroupID, setGroupID, setGroupSequence, setLastValueProperty, setMessageID, setOwner, setPaged, setReplyTo, setRoutingType, setScheduledDeliveryTime, setTimestamp, setType, setUserID, setValidatedUserID, toCompositeData, toCore, toCoreMethods inherited from class org.apache.activemq.artemis.api.core.RefCountMessage
counterString, debugLocations, deferredDebug, deferredDebug, deferredDebug, disableErrorCheck, durableDown, durableUp, getDurableCount, getParentRef, getRefCount, getUsage, getUserContext, isRefDebugEnabled, isRefTraceEnabled, isReleased, onDown, onUp, refDown, refUp, registerDebug, releaseComplete, released, setParentRef, setUserContext, usageDown, usageUpMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitMethods inherited from interface org.apache.activemq.artemis.api.core.client.ClientMessage
acknowledge, getBodyInputStream, getDeliveryCount, individualAcknowledge, putBooleanProperty, putBooleanProperty, putByteProperty, putByteProperty, putBytesProperty, putBytesProperty, putCharProperty, putCharProperty, putDoubleProperty, putDoubleProperty, putFloatProperty, putFloatProperty, putIntProperty, putIntProperty, putLongProperty, putLongProperty, putShortProperty, putShortProperty, putStringProperty, setBodyInputStream, setDeliveryCount, writeBodyBufferBytes, writeBodyBufferStringMethods inherited from interface org.apache.activemq.artemis.core.client.impl.ClientMessageInternal
getFlowControlSize, getProperties, isCompressed, onReceipt, setFlowControlSizeMethods inherited from interface org.apache.activemq.artemis.api.core.ICoreMessage
getBodyBufferSize, getBuffer, getDataBuffer, getEndOfBodyPosition, getHeadersAndPropertiesEncodeSize, getLargeBodyReader, getReadOnlyBodyBuffer, getType, isConfirmed, isServerMessage, moveHeadersAndProperties, receiveBuffer_1X, sendBuffer_1X, setBuffer, setConfirmed, setType, toMapMethods inherited from interface org.apache.activemq.artemis.api.core.Message
acceptsConsumer, clearAMQPProperties, clearInternalProperties, containsProperty, containsProperty, copy, copy, copy, durableDown, durableUp, getAddress, getAddressSimpleString, getAnnotation, getAnnotationString, getBooleanProperty, getBooleanProperty, getBrokerProperty, getByteProperty, getByteProperty, getBytesProperty, getBytesProperty, getConnectionID, getCorrelationID, getDoubleProperty, getDoubleProperty, getDuplicateIDBytes, getDuplicateProperty, getDurableCount, getExpiration, getExtraBytesProperty, getFloatProperty, getFloatProperty, getGroupID, getGroupSequence, getIngressTimestamp, getIntProperty, getIntProperty, getLastValueProperty, getLongProperty, getLongProperty, getMemoryEstimate, getMessageID, getObjectProperty, getObjectProperty, getObjectPropertyForFilter, getOriginalEstimate, getOwner, getPersistentSize, getPersister, getPersistSize, getPriority, getPropertyNames, getProtocolName, getRefCount, getReplyTo, getRoutingType, getScheduledDeliveryTime, getShortProperty, getShortProperty, getSimpleStringProperty, getSimpleStringProperty, getStringBody, getStringProperty, getStringProperty, getTimestamp, getUsage, getUserContext, getUserID, getValidatedUserID, getWholeMessageSize, hasScheduledDeliveryTime, isDurable, isExpired, isPaged, messageChanged, persist, putExtraBytesProperty, putObjectProperty, putObjectProperty, putStringProperty, putStringProperty, receiveBuffer, reencode, refDown, referenceOriginalMessage, refUp, rejectConsumer, reloadPersistence, removeAnnotation, removeExtraBytesProperty, removeProperty, removeProperty, routed, sendBuffer, setAddress, setAddress, setAnnotation, setBrokerProperty, setConnectionID, setCorrelationID, setDurable, setExpiration, setGroupID, setGroupID, setGroupSequence, setIngressTimestamp, setLastValueProperty, setMessageID, setOwner, setPaged, setPriority, setReplyTo, setRoutingType, setScheduledDeliveryTime, setTimestamp, setUserContext, setUserID, setValidatedUserID, toCompositeData, toCore, toCore, toMap, toPropertyMap, toPropertyMap, usageDown, usageUp
-
Constructor Details
-
ClientLargeMessageImpl
public ClientLargeMessageImpl()
-
-
Method Details
-
setLargeMessageSize
public void setLargeMessageSize(long largeMessageSize) - Specified by:
setLargeMessageSizein interfaceClientLargeMessageInternal
-
getLargeMessageSize
public long getLargeMessageSize() -
getEncodeSize
public int getEncodeSize()Description copied from interface:MessageReturns the size of the encoded message.- Specified by:
getEncodeSizein interfaceMessage- Overrides:
getEncodeSizein classCoreMessage- Returns:
- the size of the encoded message
-
isLargeMessage
public boolean isLargeMessage()- Specified by:
isLargeMessagein interfaceMessage- Overrides:
isLargeMessagein classClientMessageImpl
-
setLargeMessageController
- Specified by:
setLargeMessageControllerin interfaceClientLargeMessageInternal
-
checkCompletion
Description copied from interface:ClientMessageThis can be optionally used to verify if the entire message has been received. It won't have any effect on regular messages but it may be helpful on large messages. The use case for this is to make sure there won't be an exception while getting the buffer. Using getBodyBuffer directly would have the same effect but you could get a Runtime non checked Exception instead- Specified by:
checkCompletionin interfaceClientMessage- Overrides:
checkCompletionin classClientMessageImpl- Throws:
ActiveMQException
-
getBodyBuffer
Description copied from class:CoreMessageThe buffer to write the body. Warning: If you just want to read the content of a message, useICoreMessage.getDataBuffer()orICoreMessage.getReadOnlyBodyBuffer()- Specified by:
getBodyBufferin interfaceClientMessage- Specified by:
getBodyBufferin interfaceICoreMessage- Specified by:
getBodyBufferin interfaceMessage- Overrides:
getBodyBufferin classCoreMessage
-
getBodySize
public int getBodySize()Description copied from interface:ClientMessageReturns the size (in bytes) of this message's body.- Specified by:
getBodySizein interfaceClientMessage- Overrides:
getBodySizein classClientMessageImpl- Returns:
- the size (in bytes) of this message's body
-
getLargeMessageController
- Specified by:
getLargeMessageControllerin interfaceClientLargeMessageInternal
-
saveToOutputStream
Description copied from interface:ClientMessageSaves the content of the message to the OutputStream. It will block until the entire content is transferred to the OutputStream.- Specified by:
saveToOutputStreamin interfaceClientMessage- Overrides:
saveToOutputStreamin classClientMessageImpl- Throws:
ActiveMQException
-
setOutputStream
Description copied from interface:ClientMessageSets the OutputStream that will receive the content of a message received in a non blocking way.This method is used when consuming large messages
- Specified by:
setOutputStreamin interfaceClientMessage- Overrides:
setOutputStreamin classClientMessageImpl- Returns:
- this ClientMessage
- Throws:
ActiveMQException
-
waitOutputStreamCompletion
Description copied from interface:ClientMessageWait the outputStream completion of the message.This method is used when consuming large messages
- Specified by:
waitOutputStreamCompletionin interfaceClientMessage- Overrides:
waitOutputStreamCompletionin classClientMessageImpl- Parameters:
timeMilliseconds- - 0 means wait forever- Returns:
- true if it reached the end
- Throws:
ActiveMQException
-
discardBody
public void discardBody()- Specified by:
discardBodyin interfaceClientMessageInternal- Overrides:
discardBodyin classClientMessageImpl
-
retrieveExistingData
-