Interface ClientMessage
- All Superinterfaces:
ICoreMessage, Message
A ClientMessage represents a message sent and/or received by ActiveMQ Artemis.
-
Field Summary
Fields inherited from interface 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 -
Method Summary
Modifier and TypeMethodDescriptionAcknowledges reception of this message.voidThis can be optionally used to verify if the entire message has been received.The buffer to write the body.Return the bodyInputStream for large messagesintReturns the size (in bytes) of this message's body.intReturns the number of times this message was delivered..Acknowledges reception of a single message.putBooleanProperty(String key, boolean value) Overridden fromMessageto enable fluent APIputBooleanProperty(SimpleString key, boolean value) Overridden fromMessageto enable fluent APIputByteProperty(String key, byte value) Overridden fromMessageto enable fluent APIputByteProperty(SimpleString key, byte value) Overridden fromMessageto enable fluent APIputBytesProperty(String key, byte[] value) Overridden fromMessageto enable fluent APIputBytesProperty(SimpleString key, byte[] value) Overridden fromMessageto enable fluent APIputCharProperty(String key, char value) Overridden fromMessageto enable fluent APIputCharProperty(SimpleString key, char value) Overridden fromMessageto enable fluent APIputDoubleProperty(String key, double value) Overridden fromMessageto enable fluent APIputDoubleProperty(SimpleString key, double value) Overridden fromMessageto enable fluent APIputFloatProperty(String key, float value) Overridden fromMessageto enable fluent APIputFloatProperty(SimpleString key, float value) Overridden fromMessageto enable fluent APIputIntProperty(String key, int value) Overridden fromMessageto enable fluent APIputIntProperty(SimpleString key, int value) Overridden fromMessageto enable fluent APIputLongProperty(String key, long value) Overridden fromMessageto enable fluent APIputLongProperty(SimpleString key, long value) Overridden fromMessageto enable fluent APIputShortProperty(String key, short value) Overridden fromMessageto enable fluent APIputShortProperty(SimpleString key, short value) Overridden fromMessageto enable fluent APIputStringProperty(String key, String value) Overridden fromMessageto enable fluent APIvoidSaves the content of the message to the OutputStream.setBodyInputStream(InputStream bodyInputStream) Sets the body's IntputStream.setDeliveryCount(int deliveryCount) Sets the delivery count for this message.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.writeBodyBufferBytes(byte[] bytes) Overridden fromMessageto enable fluent APIwriteBodyBufferString(String string) Overridden fromMessageto enable fluent APIMethods inherited from interface ICoreMessage
copy, getBodyBufferSize, getBuffer, getDataBuffer, getEndOfBodyPosition, getHeadersAndPropertiesEncodeSize, getLargeBodyReader, getReadOnlyBodyBuffer, getType, isConfirmed, isServerMessage, moveHeadersAndProperties, receiveBuffer_1X, sendBuffer_1X, setBuffer, setConfirmed, setType, toMapMethods inherited from interface 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, isLargeMessage, 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
-
Method Details
-
getDeliveryCount
int getDeliveryCount()Returns the number of times this message was delivered..- Returns:
- the number of times this message was delivered.
-
setDeliveryCount
Sets the delivery count for this message.This method is not meant to be called by ActiveMQ Artemis clients.
- Parameters:
deliveryCount- message delivery count- Returns:
- this ClientMessage
-
acknowledge
Acknowledges 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.- Throws:
ActiveMQException- if an error occurred while acknowledging the message.- See Also:
-
individualAcknowledge
Acknowledges 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.- Throws:
ActiveMQException- if an error occurred while acknowledging the message.- See Also:
-
checkCompletion
This 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- Throws:
ActiveMQException
-
getBodySize
int getBodySize()Returns the size (in bytes) of this message's body.- Returns:
- the size (in bytes) of this message's body
-
setOutputStream
Sets the OutputStream that will receive the content of a message received in a non blocking way.This method is used when consuming large messages
- Returns:
- this ClientMessage
- Throws:
ActiveMQException
-
saveToOutputStream
Saves the content of the message to the OutputStream. It will block until the entire content is transferred to the OutputStream.- Throws:
ActiveMQException
-
waitOutputStreamCompletion
Wait the outputStream completion of the message.This method is used when consuming large messages
- Parameters:
timeMilliseconds- - 0 means wait forever- Returns:
- true if it reached the end
- Throws:
ActiveMQException
-
setBodyInputStream
Sets the body's IntputStream.This method is used when sending large messages
- Returns:
- this ClientMessage
-
getBodyInputStream
InputStream getBodyInputStream()Return the bodyInputStream for large messages- Specified by:
getBodyInputStreamin interfaceICoreMessage- Specified by:
getBodyInputStreamin interfaceMessage
-
getBodyBuffer
ActiveMQBuffer getBodyBuffer()The buffer to write the body. Warning: If you just want to read the content of a message, use getDataBuffer() or getReadOnlyBuffer();- Specified by:
getBodyBufferin interfaceICoreMessage- Specified by:
getBodyBufferin interfaceMessage
-
putBooleanProperty
Overridden fromMessageto enable fluent API- Specified by:
putBooleanPropertyin interfaceMessage
-
putBooleanProperty
Overridden fromMessageto enable fluent API- Specified by:
putBooleanPropertyin interfaceMessage
-
putByteProperty
Overridden fromMessageto enable fluent API- Specified by:
putBytePropertyin interfaceMessage
-
putByteProperty
Overridden fromMessageto enable fluent API- Specified by:
putBytePropertyin interfaceMessage
-
putBytesProperty
Overridden fromMessageto enable fluent API- Specified by:
putBytesPropertyin interfaceMessage
-
putBytesProperty
Overridden fromMessageto enable fluent API- Specified by:
putBytesPropertyin interfaceMessage
-
putShortProperty
Overridden fromMessageto enable fluent API- Specified by:
putShortPropertyin interfaceMessage
-
putShortProperty
Overridden fromMessageto enable fluent API- Specified by:
putShortPropertyin interfaceMessage
-
putCharProperty
Overridden fromMessageto enable fluent API- Specified by:
putCharPropertyin interfaceMessage
-
putCharProperty
Overridden fromMessageto enable fluent API- Specified by:
putCharPropertyin interfaceMessage
-
putIntProperty
Overridden fromMessageto enable fluent API- Specified by:
putIntPropertyin interfaceMessage
-
putIntProperty
Overridden fromMessageto enable fluent API- Specified by:
putIntPropertyin interfaceMessage
-
putLongProperty
Overridden fromMessageto enable fluent API- Specified by:
putLongPropertyin interfaceMessage
-
putLongProperty
Overridden fromMessageto enable fluent API- Specified by:
putLongPropertyin interfaceMessage
-
putFloatProperty
Overridden fromMessageto enable fluent API- Specified by:
putFloatPropertyin interfaceMessage
-
putFloatProperty
Overridden fromMessageto enable fluent API- Specified by:
putFloatPropertyin interfaceMessage
-
putDoubleProperty
Overridden fromMessageto enable fluent API- Specified by:
putDoublePropertyin interfaceMessage
-
putDoubleProperty
Overridden fromMessageto enable fluent API- Specified by:
putDoublePropertyin interfaceMessage
-
putStringProperty
Overridden fromMessageto enable fluent API- Specified by:
putStringPropertyin interfaceMessage- Parameters:
key- property namevalue- property value
-
writeBodyBufferBytes
Overridden fromMessageto enable fluent API -
writeBodyBufferString
Overridden fromMessageto enable fluent API
-