Class ClientMessageImpl
- All Implemented Interfaces:
ClientMessage,ICoreMessage,Message,ClientMessageInternal
- Direct Known Subclasses:
ClientLargeMessageImpl
-
Field Summary
FieldsFields 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
ConstructorsModifierConstructorDescriptionClientMessageImpl(byte type, boolean durable, long expiration, long timestamp, byte priority, int initialMessageBufferSize) ClientMessageImpl(byte type, boolean durable, long expiration, long timestamp, byte priority, int initialMessageBufferSize, CoreMessageObjectPools coreMessageObjectPools) protectedClientMessageImpl(CoreMessageObjectPools coreMessageObjectPools) -
Method Summary
Modifier and TypeMethodDescriptionAcknowledges reception of this message.voidThis can be optionally used to verify if the entire message has been received.copy()It will generate a new instance of the message encode, being a deep copy, new properties, new everythingvoidReturn the bodyInputStream for large messagesintReturns the size (in bytes) of this message's body.intReturns the number of times this message was delivered..intAcknowledges reception of a single message.booleanbooleanbooleanvoidonReceipt(ClientConsumerInternal consumer) putBooleanProperty(String key, boolean value) Callers must callMessage.reencode()in order to be sent to clientsputBooleanProperty(SimpleString key, boolean value) Callers must callMessage.reencode()in order to be sent to clientsputByteProperty(String key, byte value) Callers must callMessage.reencode()in order to be sent to clientsputByteProperty(SimpleString key, byte value) Callers must callMessage.reencode()in order to be sent to clientsputBytesProperty(String key, byte[] value) Callers must callMessage.reencode()in order to be sent to clientsputBytesProperty(SimpleString key, byte[] value) Callers must callMessage.reencode()in order to be sent to clientsputCharProperty(String key, char value) Callers must callMessage.reencode()in order to be sent to clientsputCharProperty(SimpleString key, char value) Callers must callMessage.reencode()in order to be sent to clientsputDoubleProperty(String key, double value) Callers must callMessage.reencode()in order to be sent to clientsputDoubleProperty(SimpleString key, double value) Callers must callMessage.reencode()in order to be sent to clientsputFloatProperty(String key, float value) Callers must callMessage.reencode()in order to be sent to clientsputFloatProperty(SimpleString key, float value) Callers must callMessage.reencode()in order to be sent to clientsputIntProperty(String key, int value) Callers must callMessage.reencode()in order to be sent to clientsputIntProperty(SimpleString key, int value) Callers must callMessage.reencode()in order to be sent to clientsputLongProperty(String key, long value) Callers must callMessage.reencode()in order to be sent to clientsputLongProperty(SimpleString key, long value) Callers must callMessage.reencode()in order to be sent to clientsputObjectProperty(String key, Object value) Callers must callMessage.reencode()in order to be sent to clientsputObjectProperty(SimpleString key, Object value) Callers must callMessage.reencode()in order to be sent to clientsputShortProperty(String key, short value) Callers must callMessage.reencode()in order to be sent to clientsputShortProperty(SimpleString key, short value) Callers must callMessage.reencode()in order to be sent to clientsputStringProperty(String key, String value) Puts a String property in this message.putStringProperty(SimpleString key, String value) putStringProperty(SimpleString key, SimpleString value) voidSaves the content of the message to the OutputStream.setBodyInputStream(InputStream bodyInputStream) Sets the body's IntputStream.voidsetConfirmed(boolean confirmed) setDeliveryCount(int deliveryCount) Sets the delivery count for this message.setDurable(boolean durable) Sets whether this message is durable or not.setExpiration(long expiration) Sets the expiration of this message.voidsetFlowControlSize(int flowControlSize) Sets the OutputStream that will receive the content of a message received in a non blocking way.setPriority(byte priority) Sets the message priority.toString()booleanwaitOutputStreamCompletion(long timeMilliseconds) Wait the outputStream completion of the message.writeBodyBufferBytes(byte[] bytes) Overridden fromMessageto enable fluent APIwriteBodyBufferString(String string) Overridden fromMessageto enable fluent APIMethods inherited from class org.apache.activemq.artemis.core.message.impl.CoreMessage
checkEncode, clearAMQPProperties, clearInternalProperties, containsProperty, containsProperty, copy, decodeHeadersAndProperties, encode, encodeHeadersAndProperties, getAddress, getAddressSimpleString, getAnnotation, getBodyBuffer, getBodyBufferSize, getBooleanProperty, getBooleanProperty, getBuffer, getByteProperty, getByteProperty, getBytesProperty, getBytesProperty, getCorrelationID, getDataBuffer, getDoubleProperty, getDoubleProperty, getDuplicateProperty, getEncodeSize, 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
getBodyBufferMethods inherited from interface org.apache.activemq.artemis.core.client.impl.ClientMessageInternal
getPropertiesMethods inherited from interface org.apache.activemq.artemis.api.core.ICoreMessage
getBodyBufferSize, getBuffer, getDataBuffer, getEndOfBodyPosition, getHeadersAndPropertiesEncodeSize, getReadOnlyBodyBuffer, getType, isServerMessage, moveHeadersAndProperties, receiveBuffer_1X, sendBuffer_1X, setBuffer, setType, toMapMethods inherited from interface org.apache.activemq.artemis.api.core.Message
acceptsConsumer, clearAMQPProperties, clearInternalProperties, containsProperty, containsProperty, copy, copy, durableDown, durableUp, getAddress, getAddressSimpleString, getAnnotation, getAnnotationString, getBooleanProperty, getBooleanProperty, getBrokerProperty, getByteProperty, getByteProperty, getBytesProperty, getBytesProperty, getConnectionID, getCorrelationID, getDoubleProperty, getDoubleProperty, getDuplicateIDBytes, getDuplicateProperty, getDurableCount, getEncodeSize, 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, receiveBuffer, reencode, refDown, referenceOriginalMessage, refUp, rejectConsumer, reloadPersistence, removeAnnotation, removeExtraBytesProperty, removeProperty, removeProperty, routed, sendBuffer, setAddress, setAddress, setAnnotation, setBrokerProperty, setConnectionID, setCorrelationID, setGroupID, setGroupID, setGroupSequence, setIngressTimestamp, setLastValueProperty, setMessageID, setOwner, setPaged, setReplyTo, setRoutingType, setScheduledDeliveryTime, setTimestamp, setUserContext, setUserID, setValidatedUserID, toCompositeData, toCore, toCore, toMap, toPropertyMap, toPropertyMap, usageDown, usageUp
-
Field Details
-
REPLYTO_HEADER_NAME
-
-
Constructor Details
-
ClientMessageImpl
public ClientMessageImpl() -
ClientMessageImpl
-
ClientMessageImpl
-
ClientMessageImpl
public ClientMessageImpl(byte type, boolean durable, long expiration, long timestamp, byte priority, int initialMessageBufferSize, CoreMessageObjectPools coreMessageObjectPools) -
ClientMessageImpl
public ClientMessageImpl(byte type, boolean durable, long expiration, long timestamp, byte priority, int initialMessageBufferSize)
-
-
Method Details
-
setDurable
Description copied from interface:MessageSets whether this message is durable or not.- Specified by:
setDurablein interfaceMessage- Overrides:
setDurablein classCoreMessage- Parameters:
durable-trueto flag this message as durable,falseelse
-
setExpiration
Description copied from interface:MessageSets the expiration of this message.- Specified by:
setExpirationin interfaceMessage- Overrides:
setExpirationin classCoreMessage- Parameters:
expiration- expiration time
-
setPriority
Description copied from interface:MessageSets the message priority.Value must be between 0 and 9 inclusive.
- Specified by:
setPriorityin interfaceMessage- Overrides:
setPriorityin classCoreMessage- Parameters:
priority- the new message priority
-
setUserID
- Overrides:
setUserIDin classCoreMessage
-
onReceipt
- Specified by:
onReceiptin interfaceClientMessageInternal
-
setDeliveryCount
Description copied from interface:ClientMessageSets the delivery count for this message.This method is not meant to be called by ActiveMQ Artemis clients.
- Specified by:
setDeliveryCountin interfaceClientMessage- Parameters:
deliveryCount- message delivery count- Returns:
- this ClientMessage
-
getDeliveryCount
public int getDeliveryCount()Description copied from interface:ClientMessageReturns the number of times this message was delivered..- Specified by:
getDeliveryCountin interfaceClientMessage- Returns:
- the number of times this message was delivered.
-
acknowledge
Description copied from interface:ClientMessageAcknowledges reception of this message.If the session responsible to acknowledge this message has
autoCommitAcksset totrue, the transaction will automatically commit the current transaction. Otherwise, this acknowledgement will not be committed until the client commits the session transaction.- Specified by:
acknowledgein interfaceClientMessage- Throws:
ActiveMQException- if an error occurred while acknowledging the message.- See Also:
-
individualAcknowledge
Description copied from interface:ClientMessageAcknowledges reception of a single message.If the session responsible to acknowledge this message has
autoCommitAcksset totrue, the transaction will automatically commit the current transaction. Otherwise, this acknowledgement will not be committed until the client commits the session transaction.- Specified by:
individualAcknowledgein interfaceClientMessage- Throws:
ActiveMQException- if an error occurred while acknowledging the message.- See Also:
-
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- Throws:
ActiveMQException
-
getFlowControlSize
public int getFlowControlSize()- Specified by:
getFlowControlSizein interfaceClientMessageInternal
-
setFlowControlSize
public void setFlowControlSize(int flowControlSize) - Specified by:
setFlowControlSizein interfaceClientMessageInternal
-
isLargeMessage
public boolean isLargeMessage()- Specified by:
isLargeMessagein interfaceMessage- Overrides:
isLargeMessagein classCoreMessage
-
isCompressed
public boolean isCompressed()- Specified by:
isCompressedin interfaceClientMessageInternal
-
getBodySize
public int getBodySize()Description copied from interface:ClientMessageReturns the size (in bytes) of this message's body.- Specified by:
getBodySizein interfaceClientMessage- Returns:
- the size (in bytes) of this message's body
-
toString
- Overrides:
toStringin classCoreMessage
-
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- 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- 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- Parameters:
timeMilliseconds- - 0 means wait forever- Returns:
- true if it reached the end
- Throws:
ActiveMQException
-
discardBody
public void discardBody()- Specified by:
discardBodyin interfaceClientMessageInternal
-
getBodyInputStream
Description copied from interface:ClientMessageReturn the bodyInputStream for large messages- Specified by:
getBodyInputStreamin interfaceClientMessage- Specified by:
getBodyInputStreamin interfaceICoreMessage- Specified by:
getBodyInputStreamin interfaceMessage- Overrides:
getBodyInputStreamin classCoreMessage
-
setBodyInputStream
Description copied from interface:ClientMessageSets the body's IntputStream.This method is used when sending large messages
- Specified by:
setBodyInputStreamin interfaceClientMessage- Returns:
- this ClientMessage
-
getLargeBodyReader
- Specified by:
getLargeBodyReaderin interfaceICoreMessage- Overrides:
getLargeBodyReaderin classCoreMessage- Throws:
ActiveMQException
-
putBooleanProperty
Description copied from interface:MessageCallers must callMessage.reencode()in order to be sent to clients- Specified by:
putBooleanPropertyin interfaceClientMessage- Specified by:
putBooleanPropertyin interfaceMessage- Overrides:
putBooleanPropertyin classCoreMessage
-
putByteProperty
Description copied from interface:MessageCallers must callMessage.reencode()in order to be sent to clients- Specified by:
putBytePropertyin interfaceClientMessage- Specified by:
putBytePropertyin interfaceMessage- Overrides:
putBytePropertyin classCoreMessage
-
putBytesProperty
Description copied from interface:MessageCallers must callMessage.reencode()in order to be sent to clients- Specified by:
putBytesPropertyin interfaceClientMessage- Specified by:
putBytesPropertyin interfaceMessage- Overrides:
putBytesPropertyin classCoreMessage
-
putCharProperty
Description copied from interface:MessageCallers must callMessage.reencode()in order to be sent to clients- Specified by:
putCharPropertyin interfaceClientMessage- Specified by:
putCharPropertyin interfaceMessage- Overrides:
putCharPropertyin classCoreMessage
-
putCharProperty
Description copied from interface:MessageCallers must callMessage.reencode()in order to be sent to clients- Specified by:
putCharPropertyin interfaceClientMessage- Specified by:
putCharPropertyin interfaceMessage- Overrides:
putCharPropertyin classCoreMessage
-
putShortProperty
Description copied from interface:MessageCallers must callMessage.reencode()in order to be sent to clients- Specified by:
putShortPropertyin interfaceClientMessage- Specified by:
putShortPropertyin interfaceMessage- Overrides:
putShortPropertyin classCoreMessage
-
putIntProperty
Description copied from interface:MessageCallers must callMessage.reencode()in order to be sent to clients- Specified by:
putIntPropertyin interfaceClientMessage- Specified by:
putIntPropertyin interfaceMessage- Overrides:
putIntPropertyin classCoreMessage
-
putLongProperty
Description copied from interface:MessageCallers must callMessage.reencode()in order to be sent to clients- Specified by:
putLongPropertyin interfaceClientMessage- Specified by:
putLongPropertyin interfaceMessage- Overrides:
putLongPropertyin classCoreMessage
-
putFloatProperty
Description copied from interface:MessageCallers must callMessage.reencode()in order to be sent to clients- Specified by:
putFloatPropertyin interfaceClientMessage- Specified by:
putFloatPropertyin interfaceMessage- Overrides:
putFloatPropertyin classCoreMessage
-
putDoubleProperty
Description copied from interface:MessageCallers must callMessage.reencode()in order to be sent to clients- Specified by:
putDoublePropertyin interfaceClientMessage- Specified by:
putDoublePropertyin interfaceMessage- Overrides:
putDoublePropertyin classCoreMessage
-
putStringProperty
- Specified by:
putStringPropertyin interfaceMessage- Overrides:
putStringPropertyin classCoreMessage
-
putStringProperty
- Specified by:
putStringPropertyin interfaceMessage- Overrides:
putStringPropertyin classCoreMessage
-
putObjectProperty
public ClientMessageImpl putObjectProperty(SimpleString key, Object value) throws ActiveMQPropertyConversionException Description copied from interface:MessageCallers must callMessage.reencode()in order to be sent to clients- Specified by:
putObjectPropertyin interfaceMessage- Overrides:
putObjectPropertyin classCoreMessage- Throws:
ActiveMQPropertyConversionException
-
putObjectProperty
public ClientMessageImpl putObjectProperty(String key, Object value) throws ActiveMQPropertyConversionException Description copied from interface:MessageCallers must callMessage.reencode()in order to be sent to clients- Specified by:
putObjectPropertyin interfaceMessage- Overrides:
putObjectPropertyin classCoreMessage- Throws:
ActiveMQPropertyConversionException
-
putBooleanProperty
Description copied from interface:MessageCallers must callMessage.reencode()in order to be sent to clients- Specified by:
putBooleanPropertyin interfaceClientMessage- Specified by:
putBooleanPropertyin interfaceMessage- Overrides:
putBooleanPropertyin classCoreMessage
-
putByteProperty
Description copied from interface:MessageCallers must callMessage.reencode()in order to be sent to clients- Specified by:
putBytePropertyin interfaceClientMessage- Specified by:
putBytePropertyin interfaceMessage- Overrides:
putBytePropertyin classCoreMessage
-
putBytesProperty
Description copied from interface:MessageCallers must callMessage.reencode()in order to be sent to clients- Specified by:
putBytesPropertyin interfaceClientMessage- Specified by:
putBytesPropertyin interfaceMessage- Overrides:
putBytesPropertyin classCoreMessage
-
putShortProperty
Description copied from interface:MessageCallers must callMessage.reencode()in order to be sent to clients- Specified by:
putShortPropertyin interfaceClientMessage- Specified by:
putShortPropertyin interfaceMessage- Overrides:
putShortPropertyin classCoreMessage
-
putIntProperty
Description copied from interface:MessageCallers must callMessage.reencode()in order to be sent to clients- Specified by:
putIntPropertyin interfaceClientMessage- Specified by:
putIntPropertyin interfaceMessage- Overrides:
putIntPropertyin classCoreMessage
-
putLongProperty
Description copied from interface:MessageCallers must callMessage.reencode()in order to be sent to clients- Specified by:
putLongPropertyin interfaceClientMessage- Specified by:
putLongPropertyin interfaceMessage- Overrides:
putLongPropertyin classCoreMessage
-
putFloatProperty
Description copied from interface:MessageCallers must callMessage.reencode()in order to be sent to clients- Specified by:
putFloatPropertyin interfaceClientMessage- Specified by:
putFloatPropertyin interfaceMessage- Overrides:
putFloatPropertyin classCoreMessage
-
putDoubleProperty
Description copied from interface:MessageCallers must callMessage.reencode()in order to be sent to clients- Specified by:
putDoublePropertyin interfaceClientMessage- Specified by:
putDoublePropertyin interfaceMessage- Overrides:
putDoublePropertyin classCoreMessage
-
putStringProperty
Description copied from interface:MessagePuts a String property in this message.Callers must call
Message.reencode()in order to be sent to clients- Specified by:
putStringPropertyin interfaceClientMessage- Specified by:
putStringPropertyin interfaceMessage- Overrides:
putStringPropertyin classCoreMessage- Parameters:
key- property namevalue- property value
-
writeBodyBufferBytes
Description copied from interface:ClientMessageOverridden fromMessageto enable fluent API- Specified by:
writeBodyBufferBytesin interfaceClientMessage
-
writeBodyBufferString
Description copied from interface:ClientMessageOverridden fromMessageto enable fluent API- Specified by:
writeBodyBufferStringin interfaceClientMessage
-
copy
Description copied from interface:MessageIt will generate a new instance of the message encode, being a deep copy, new properties, new everything- Specified by:
copyin interfaceMessage- Overrides:
copyin classCoreMessage
-
isConfirmed
public boolean isConfirmed()- Specified by:
isConfirmedin interfaceICoreMessage
-
setConfirmed
public void setConfirmed(boolean confirmed) - Specified by:
setConfirmedin interfaceICoreMessage
-