Class CoreMessage
- java.lang.Object
-
- org.apache.activemq.artemis.api.core.RefCountMessage
-
- org.apache.activemq.artemis.core.message.impl.CoreMessage
-
- All Implemented Interfaces:
ICoreMessage,Message
- Direct Known Subclasses:
ClientMessageImpl,LargeServerMessageImpl
public class CoreMessage extends RefCountMessage implements ICoreMessage
Note: you shouldn't change properties using multi-threads. Change your properties before you can send it to multiple consumers
-
-
Field Summary
Fields Modifier and Type Field Description protected SimpleStringaddressstatic intBODY_OFFSETprotected io.netty.buffer.ByteBufbufferThat is the readInto for the whole message, including properties..static intBUFFER_HEADER_SPACEprotected booleandurableprotected intendOfBodyPositionprotected intmemoryEstimateprotected longmessageIDprotected intmessageIDPositionprotected bytepriorityprotected TypedPropertiespropertiesprotected longtimestampprotected bytetypeprotected ResetLimitWrappedActiveMQBufferwritableBuffer-
Fields inherited from interface org.apache.activemq.artemis.api.core.Message
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, STREAM_TYPE, TEXT_TYPE
-
-
Constructor Summary
Constructors Modifier Constructor Description CoreMessage()CoreMessage(long id, int bufferSize)CoreMessage(long id, int bufferSize, CoreMessageObjectPools coreMessageObjectPools)protectedCoreMessage(CoreMessage other)protectedCoreMessage(CoreMessage other, TypedProperties copyProperties)CoreMessage(CoreMessageObjectPools coreMessageObjectPools)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected voidcheckEncode()voidclearInternalProperties()booleancontainsProperty(String key)booleancontainsProperty(SimpleString key)Messagecopy()It will generate a new instance of the message encode, being a deep copy, new properties, new everythingMessagecopy(long newID)It will generate a new instance of the message encode, being a deep copy, new properties, new everythingvoiddecodeHeadersAndProperties(io.netty.buffer.ByteBuf buffer)CoreMessageencode()voidencodeHeadersAndProperties(io.netty.buffer.ByteBuf buffer)StringgetAddress()SimpleStringgetAddressSimpleString()ObjectgetAnnotation(SimpleString key)On core there's no delivery annotationActiveMQBuffergetBodyBuffer()The buffer to write the body.intgetBodyBufferSize()Returns the length in bytes of the body buffer.InputStreamgetBodyInputStream()BooleangetBooleanProperty(String key)BooleangetBooleanProperty(SimpleString key)io.netty.buffer.ByteBufgetBuffer()BytegetByteProperty(String key)BytegetByteProperty(SimpleString key)byte[]getBytesProperty(String key)byte[]getBytesProperty(SimpleString key)ObjectgetCorrelationID()ActiveMQBuffergetDataBuffer()This will return the proper buffer to represent the data of the Message.DoublegetDoubleProperty(String key)DoublegetDoubleProperty(SimpleString key)ObjectgetDuplicateProperty()intgetEncodeSize()Returns the size of the encoded message.intgetEndOfBodyPosition()longgetExpiration()Returns the expiration time of this message.FloatgetFloatProperty(String key)FloatgetFloatProperty(SimpleString key)SimpleStringgetGroupID()intgetGroupSequence()intgetHeadersAndPropertiesEncodeSize()IntegergetIntProperty(String key)IntegergetIntProperty(SimpleString key)LargeBodyReadergetLargeBodyReader()SimpleStringgetLastValueProperty()LonggetLongProperty(String key)LonggetLongProperty(SimpleString key)intgetMemoryEstimate()longgetMessageID()Returns the messageID.ObjectgetObjectProperty(String key)ObjectgetObjectProperty(SimpleString key)ObjectgetOwner()longgetPersistentSize()This is the size of the message when persisted on disk which is used for metrics tracking Note that even if the message itself is not persisted on disk (ie non-durable) this value is still used for metrics tracking If a normal message it will be the encoded message size If a large message it will be encoded message size + large message body sizePersister<Message>getPersister()intgetPersistSize()bytegetPriority()Returns the message priority.TypedPropertiesgetProperties()I am keeping this synchronized as the decode of the Properties is lazySet<SimpleString>getPropertyNames()Returns all the names of the properties for this message.StringgetProtocolName()ActiveMQBuffergetReadOnlyBodyBuffer()Returns a new Buffer slicing the current Body.SimpleStringgetReplyTo()RoutingTypegetRoutingType()LonggetScheduledDeliveryTime()Used to calculate what is the delivery time.ShortgetShortProperty(String key)ShortgetShortProperty(SimpleString key)SimpleStringgetSimpleStringProperty(String key)SimpleStringgetSimpleStringProperty(SimpleString key)StringgetStringBody()StringgetStringProperty(String key)StringgetStringProperty(SimpleString key)longgetTimestamp()bytegetType()Return the type of the messageUUIDgetUserID()This represents historically the JMSMessageID.StringgetValidatedUserID()booleanhasScheduledDeliveryTime()Search for the existence of the property: an implementor can save the message to be decoded, if possible.CoreMessageinitBuffer(int initialMessageBufferSize)protected voidinternalSetMessageID(long messageID)This method serves as a purpose of extension.booleanisDurable()Returns whether this message is durable or not.booleanisLargeMessage()booleanisServerMessage()We are really interested if this is a LargeServerMessage.voidmessageChanged()WARNING: Calling this method on a AMQPMessage will allow the non mutable part of the message to be modified.voidmoveHeadersAndProperties(Message msg)Used on large messages treatment.voidpersist(ActiveMQBuffer targetRecord)CoreMessageputBooleanProperty(String key, boolean value)CoreMessageputBooleanProperty(SimpleString key, boolean value)CoreMessageputByteProperty(String key, byte value)CoreMessageputByteProperty(SimpleString key, byte value)CoreMessageputBytesProperty(String key, byte[] value)CoreMessageputBytesProperty(SimpleString key, byte[] value)CoreMessageputCharProperty(String key, char value)CoreMessageputCharProperty(SimpleString key, char value)CoreMessageputDoubleProperty(String key, double value)CoreMessageputDoubleProperty(SimpleString key, double value)CoreMessageputFloatProperty(String key, float value)CoreMessageputFloatProperty(SimpleString key, float value)CoreMessageputIntProperty(String key, int value)CoreMessageputIntProperty(SimpleString key, int value)CoreMessageputLongProperty(String key, long value)CoreMessageputLongProperty(SimpleString key, long value)CoreMessageputObjectProperty(String key, Object value)CoreMessageputObjectProperty(SimpleString key, Object value)CoreMessageputShortProperty(String key, short value)CoreMessageputShortProperty(SimpleString key, short value)CoreMessageputStringProperty(String key, String value)Puts a String property in this message.CoreMessageputStringProperty(SimpleString key, String value)CoreMessageputStringProperty(SimpleString key, SimpleString value)voidreceiveBuffer(io.netty.buffer.ByteBuf buffer)Used to receive this message from an encoded medium buffervoidreceiveBuffer_1X(io.netty.buffer.ByteBuf buffer)This will fix the incoming body of 1.x messagesvoidreloadPersistence(ActiveMQBuffer record, CoreMessageObjectPools pools)ObjectremoveAnnotation(SimpleString key)On core there's no delivery annotationObjectremoveProperty(String key)ObjectremoveProperty(SimpleString key)booleansearchProperty(SimpleString key)Differently fromcontainsProperty(SimpleString), this method can save decoding the message, performing a search of thekeyproperty and falling back tocontainsProperty(SimpleString)if not possible or if already decoded.voidsendBuffer(io.netty.buffer.ByteBuf sendBuffer, int deliveryCount)Used to send this message to an encoded medium buffer.voidsendBuffer_1X(io.netty.buffer.ByteBuf sendBuffer)Recast the message as an 1.4 messageCoreMessagesetAddress(String address)Look atMessage.setAddress(SimpleString)for the doc.CoreMessagesetAddress(SimpleString address)This will set the address on CoreMessage.CoreMessagesetBuffer(io.netty.buffer.ByteBuf buffer)The buffer will belong to this message, until release is called.MessagesetCorrelationID(Object correlationID)CoreMessagesetDurable(boolean durable)Sets whether this message is durable or not.CoreMessagesetExpiration(long expiration)Sets the expiration of this message.CoreMessagesetGroupID(String groupId)CoreMessagesetGroupID(SimpleString groupId)CoreMessagesetGroupSequence(int sequence)MessagesetLastValueProperty(SimpleString lastValueName)CoreMessagesetMessageID(long messageID)voidsetOwner(Object object)CoreMessagesetPriority(byte priority)Sets the message priority.CoreMessagesetReplyTo(SimpleString address)MessagesetRoutingType(RoutingType routingType)CoreMessagesetScheduledDeliveryTime(Long time)CoreMessagesetTimestamp(long timestamp)CoreMessagesetType(byte type)the type of the messageCoreMessagesetUserID(Object uuid)CoreMessagesetUserID(UUID userID)CoreMessagesetValidatedUserID(String validatedUserID)CompositeDatatoCompositeData(int fieldsLimit, int deliveryCount)CoreMessagetoCore()This should make you convert your message into Core format.CoreMessagetoCore(CoreMessageObjectPools coreMessageObjectPools)This should make you convert your message into Core format.StringtoString()-
Methods inherited from class org.apache.activemq.artemis.api.core.RefCountMessage
debugRefs, debugString, durableDown, durableUp, getDurableCount, getParentRef, getRefCount, getUsage, getUserContext, refDown, refUp, releaseComplete, setParentRef, setUserContext, usageDown, usageUp
-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
-
Methods inherited from interface org.apache.activemq.artemis.api.core.ICoreMessage
toMap
-
Methods inherited from interface org.apache.activemq.artemis.api.core.Message
acceptsConsumer, copy, durableDown, durableUp, getAnnotationString, getBrokerProperty, getConnectionID, getDuplicateIDBytes, getDurableCount, getExtraBytesProperty, getIngressTimestamp, getObjectPropertyForFilter, getRefCount, getUsage, getUserContext, getWholeMessageSize, isExpired, putExtraBytesProperty, reencode, refDown, referenceOriginalMessage, refUp, rejectConsumer, removeExtraBytesProperty, setAnnotation, setBrokerProperty, setConnectionID, setIngressTimestamp, setUserContext, toMap, toPropertyMap, toPropertyMap, usageDown, usageUp
-
-
-
-
Field Detail
-
BUFFER_HEADER_SPACE
public static final int BUFFER_HEADER_SPACE
- See Also:
- Constant Field Values
-
memoryEstimate
protected volatile int memoryEstimate
-
BODY_OFFSET
public static final int BODY_OFFSET
- See Also:
- Constant Field Values
-
buffer
protected io.netty.buffer.ByteBuf buffer
That is the readInto for the whole message, including properties.. it does not include the buffer for the Packet send and receive header on core protocol
-
writableBuffer
protected volatile ResetLimitWrappedActiveMQBuffer writableBuffer
-
endOfBodyPosition
protected int endOfBodyPosition
-
messageIDPosition
protected int messageIDPosition
-
messageID
protected long messageID
-
address
protected SimpleString address
-
type
protected byte type
-
durable
protected boolean durable
-
timestamp
protected long timestamp
-
priority
protected byte priority
-
properties
protected volatile TypedProperties properties
-
-
Constructor Detail
-
CoreMessage
public CoreMessage(CoreMessageObjectPools coreMessageObjectPools)
-
CoreMessage
public CoreMessage()
-
CoreMessage
protected CoreMessage(CoreMessage other)
-
CoreMessage
public CoreMessage(long id, int bufferSize)
-
CoreMessage
public CoreMessage(long id, int bufferSize, CoreMessageObjectPools coreMessageObjectPools)
-
CoreMessage
protected CoreMessage(CoreMessage other, TypedProperties copyProperties)
-
-
Method Detail
-
getProtocolName
public String getProtocolName()
- Specified by:
getProtocolNamein interfaceMessage
-
getAnnotation
public Object getAnnotation(SimpleString key)
On core there's no delivery annotation- Specified by:
getAnnotationin interfaceMessage
-
removeAnnotation
public Object removeAnnotation(SimpleString key)
On core there's no delivery annotation- Specified by:
removeAnnotationin interfaceMessage
-
clearInternalProperties
public void clearInternalProperties()
- Specified by:
clearInternalPropertiesin interfaceMessage
-
getPersister
public Persister<Message> getPersister()
- Specified by:
getPersisterin interfaceMessage
-
initBuffer
public CoreMessage initBuffer(int initialMessageBufferSize)
-
getReplyTo
public SimpleString getReplyTo()
- Specified by:
getReplyToin interfaceMessage
-
getRoutingType
public RoutingType getRoutingType()
- Specified by:
getRoutingTypein interfaceMessage
-
setRoutingType
public Message setRoutingType(RoutingType routingType)
- Specified by:
setRoutingTypein interfaceMessage
-
setReplyTo
public CoreMessage setReplyTo(SimpleString address)
- Specified by:
setReplyToin interfaceMessage
-
receiveBuffer
public void receiveBuffer(io.netty.buffer.ByteBuf buffer)
Description copied from interface:MessageUsed to receive this message from an encoded medium buffer- Specified by:
receiveBufferin interfaceMessage
-
receiveBuffer_1X
public void receiveBuffer_1X(io.netty.buffer.ByteBuf buffer)
This will fix the incoming body of 1.x messages- Specified by:
receiveBuffer_1Xin interfaceICoreMessage
-
getReadOnlyBodyBuffer
public ActiveMQBuffer getReadOnlyBodyBuffer()
Description copied from interface:ICoreMessageReturns a new Buffer slicing the current Body.- Specified by:
getReadOnlyBodyBufferin interfaceICoreMessage
-
getBodyBufferSize
public int getBodyBufferSize()
Description copied from interface:ICoreMessageReturns the length in bytes of the body buffer.- Specified by:
getBodyBufferSizein interfaceICoreMessage
-
getDataBuffer
public ActiveMQBuffer getDataBuffer()
This will return the proper buffer to represent the data of the Message. If compressed it will decompress. If large, it will read from the file or streaming.- Specified by:
getDataBufferin interfaceICoreMessage- Returns:
-
getGroupID
public SimpleString getGroupID()
- Specified by:
getGroupIDin interfaceMessage
-
setGroupID
public CoreMessage setGroupID(SimpleString groupId)
- Specified by:
setGroupIDin interfaceMessage
-
setGroupID
public CoreMessage setGroupID(String groupId)
- Specified by:
setGroupIDin interfaceMessage
-
getGroupSequence
public int getGroupSequence()
- Specified by:
getGroupSequencein interfaceMessage
-
setGroupSequence
public CoreMessage setGroupSequence(int sequence)
- Specified by:
setGroupSequencein interfaceMessage
-
getCorrelationID
public Object getCorrelationID()
- Specified by:
getCorrelationIDin interfaceMessage
-
setCorrelationID
public Message setCorrelationID(Object correlationID)
- Specified by:
setCorrelationIDin interfaceMessage
-
sendBuffer
public void sendBuffer(io.netty.buffer.ByteBuf sendBuffer, int deliveryCount)Description copied from interface:MessageUsed to send this message to an encoded medium buffer.- Specified by:
sendBufferin interfaceMessage- Parameters:
sendBuffer-deliveryCount- Some protocols (AMQP) will have this as part of the message. ignored on core
-
sendBuffer_1X
public void sendBuffer_1X(io.netty.buffer.ByteBuf sendBuffer)
Recast the message as an 1.4 message- Specified by:
sendBuffer_1Xin interfaceICoreMessage
-
checkEncode
protected void checkEncode()
-
getScheduledDeliveryTime
public Long getScheduledDeliveryTime()
Description copied from interface:MessageUsed to calculate what is the delivery time. Return null if not scheduled.- Specified by:
getScheduledDeliveryTimein interfaceMessage
-
setScheduledDeliveryTime
public CoreMessage setScheduledDeliveryTime(Long time)
- Specified by:
setScheduledDeliveryTimein interfaceMessage
-
getBodyInputStream
public InputStream getBodyInputStream()
- Specified by:
getBodyInputStreamin interfaceICoreMessage- Specified by:
getBodyInputStreamin interfaceMessage
-
getBodyBuffer
public 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
-
getEndOfBodyPosition
public int getEndOfBodyPosition()
- Specified by:
getEndOfBodyPositionin interfaceICoreMessage
-
messageChanged
public void messageChanged()
Description copied from interface:MessageWARNING: Calling this method on a AMQPMessage will allow the non mutable part of the message to be modified.- Specified by:
messageChangedin interfaceMessage
-
internalSetMessageID
protected void internalSetMessageID(long messageID)
This method serves as a purpose of extension. Large Message on a Core Message will have to set the messageID on the attached NewLargeMessage
-
moveHeadersAndProperties
public void moveHeadersAndProperties(Message msg)
Description copied from interface:ICoreMessageUsed on large messages treatment. this method is used to transfer properties from a temporary CoreMessage to a definitive one. This is used when before a Message was defined as a LargeMessages, its properties are then moved from the Temporary message to its final LargeMessage object. Be careful as this will not perform a copy of the Properties. For real copy, use the copy methods or copy constructors.- Specified by:
moveHeadersAndPropertiesin interfaceICoreMessage
-
copy
public Message copy()
Description copied from interface:MessageIt will generate a new instance of the message encode, being a deep copy, new properties, new everything
-
copy
public Message copy(long newID)
Description copied from interface:MessageIt will generate a new instance of the message encode, being a deep copy, new properties, new everything
-
getExpiration
public long getExpiration()
Description copied from interface:MessageReturns the expiration time of this message.- Specified by:
getExpirationin interfaceMessage
-
getTimestamp
public long getTimestamp()
- Specified by:
getTimestampin interfaceMessage
-
setTimestamp
public CoreMessage setTimestamp(long timestamp)
- Specified by:
setTimestampin interfaceMessage
-
getMessageID
public long getMessageID()
Description copied from interface:MessageReturns the messageID.
The messageID is set when the message is handled by the server.- Specified by:
getMessageIDin interfaceMessage
-
getPriority
public byte getPriority()
Description copied from interface:MessageReturns the message priority.Values range from 0 (less priority) to 9 (more priority) inclusive.
- Specified by:
getPriorityin interfaceMessage
-
getUserID
public UUID getUserID()
Description copied from interface:MessageThis represents historically the JMSMessageID. We had in the past used this for the MessageID that was sent on core messages... later on when we added AMQP this name clashed with AMQPMessage.getUserID();
-
setUserID
public CoreMessage setUserID(Object uuid)
-
getValidatedUserID
public String getValidatedUserID()
- Specified by:
getValidatedUserIDin interfaceMessage
-
setValidatedUserID
public CoreMessage setValidatedUserID(String validatedUserID)
- Specified by:
setValidatedUserIDin interfaceMessage
-
setMessageID
public CoreMessage setMessageID(long messageID)
- Specified by:
setMessageIDin interfaceMessage
-
setAddress
public CoreMessage setAddress(SimpleString address)
Description copied from interface:MessageThis will set the address on CoreMessage. Note for AMQPMessages: in AMQPMessages this will not really change the address on the message. Instead it will add a property on extraProperties which only transverse internally at the broker. Whatever you change here it won't affect anything towards the received message. If you wish to change AMQPMessages address you will have to do it directly at the AMQP Message, however beware that AMQPMessages are not supposed to be changed at the broker, so only do it if you know what you are doing.- Specified by:
setAddressin interfaceMessage- Returns:
-
getAddressSimpleString
public SimpleString getAddressSimpleString()
- Specified by:
getAddressSimpleStringin interfaceMessage
-
setExpiration
public CoreMessage setExpiration(long expiration)
Description copied from interface:MessageSets the expiration of this message.- Specified by:
setExpirationin interfaceMessage- Parameters:
expiration- expiration time
-
setPriority
public CoreMessage setPriority(byte priority)
Description copied from interface:MessageSets the message priority.Value must be between 0 and 9 inclusive.
- Specified by:
setPriorityin interfaceMessage- Parameters:
priority- the new message priority
-
setUserID
public CoreMessage setUserID(UUID userID)
-
getProperties
public final TypedProperties getProperties()
I am keeping this synchronized as the decode of the Properties is lazy
-
getMemoryEstimate
public int getMemoryEstimate()
- Specified by:
getMemoryEstimatein interfaceMessage
-
isServerMessage
public boolean isServerMessage()
Description copied from interface:ICoreMessageWe are really interested if this is a LargeServerMessage.- Specified by:
isServerMessagein interfaceICoreMessage- Returns:
-
getType
public byte getType()
Description copied from interface:ICoreMessageReturn the type of the message- Specified by:
getTypein interfaceICoreMessage- Specified by:
getTypein interfaceMessage
-
setType
public CoreMessage setType(byte type)
Description copied from interface:ICoreMessagethe type of the message- Specified by:
setTypein interfaceICoreMessage- Specified by:
setTypein interfaceMessage
-
decodeHeadersAndProperties
public void decodeHeadersAndProperties(io.netty.buffer.ByteBuf buffer)
-
encode
public CoreMessage encode()
-
encodeHeadersAndProperties
public void encodeHeadersAndProperties(io.netty.buffer.ByteBuf buffer)
-
getHeadersAndPropertiesEncodeSize
public int getHeadersAndPropertiesEncodeSize()
- Specified by:
getHeadersAndPropertiesEncodeSizein interfaceICoreMessage
-
getDuplicateProperty
public Object getDuplicateProperty()
- Specified by:
getDuplicatePropertyin interfaceMessage
-
getLastValueProperty
public SimpleString getLastValueProperty()
- Specified by:
getLastValuePropertyin interfaceMessage
-
setLastValueProperty
public Message setLastValueProperty(SimpleString lastValueName)
- Specified by:
setLastValuePropertyin interfaceMessage
-
getEncodeSize
public int getEncodeSize()
Description copied from interface:MessageReturns the size of the encoded message.- Specified by:
getEncodeSizein interfaceMessage
-
isLargeMessage
public boolean isLargeMessage()
- Specified by:
isLargeMessagein interfaceMessage
-
getAddress
public String getAddress()
- Specified by:
getAddressin interfaceMessage
-
setAddress
public CoreMessage setAddress(String address)
Description copied from interface:MessageLook atMessage.setAddress(SimpleString)for the doc.- Specified by:
setAddressin interfaceMessage- Returns:
-
setBuffer
public CoreMessage setBuffer(io.netty.buffer.ByteBuf buffer)
Description copied from interface:ICoreMessageThe buffer will belong to this message, until release is called.- Specified by:
setBufferin interfaceICoreMessage
-
getBuffer
public io.netty.buffer.ByteBuf getBuffer()
- Specified by:
getBufferin interfaceICoreMessage
-
isDurable
public boolean isDurable()
Description copied from interface:MessageReturns whether this message is durable or not.
-
setDurable
public CoreMessage setDurable(boolean durable)
Description copied from interface:MessageSets whether this message is durable or not.- Specified by:
setDurablein interfaceMessage- Parameters:
durable-trueto flag this message as durable,falseelse
-
putBooleanProperty
public CoreMessage putBooleanProperty(String key, boolean value)
- Specified by:
putBooleanPropertyin interfaceMessage
-
putBooleanProperty
public CoreMessage putBooleanProperty(SimpleString key, boolean value)
- Specified by:
putBooleanPropertyin interfaceMessage
-
getBooleanProperty
public Boolean getBooleanProperty(SimpleString key) throws ActiveMQPropertyConversionException
- Specified by:
getBooleanPropertyin interfaceMessage- Throws:
ActiveMQPropertyConversionException
-
getBooleanProperty
public Boolean getBooleanProperty(String key) throws ActiveMQPropertyConversionException
- Specified by:
getBooleanPropertyin interfaceMessage- Throws:
ActiveMQPropertyConversionException
-
putByteProperty
public CoreMessage putByteProperty(SimpleString key, byte value)
- Specified by:
putBytePropertyin interfaceMessage
-
putByteProperty
public CoreMessage putByteProperty(String key, byte value)
- Specified by:
putBytePropertyin interfaceMessage
-
getByteProperty
public Byte getByteProperty(SimpleString key) throws ActiveMQPropertyConversionException
- Specified by:
getBytePropertyin interfaceMessage- Throws:
ActiveMQPropertyConversionException
-
getByteProperty
public Byte getByteProperty(String key) throws ActiveMQPropertyConversionException
- Specified by:
getBytePropertyin interfaceMessage- Throws:
ActiveMQPropertyConversionException
-
putBytesProperty
public CoreMessage putBytesProperty(SimpleString key, byte[] value)
- Specified by:
putBytesPropertyin interfaceMessage
-
putBytesProperty
public CoreMessage putBytesProperty(String key, byte[] value)
- Specified by:
putBytesPropertyin interfaceMessage
-
getBytesProperty
public byte[] getBytesProperty(SimpleString key) throws ActiveMQPropertyConversionException
- Specified by:
getBytesPropertyin interfaceMessage- Throws:
ActiveMQPropertyConversionException
-
getBytesProperty
public byte[] getBytesProperty(String key) throws ActiveMQPropertyConversionException
- Specified by:
getBytesPropertyin interfaceMessage- Throws:
ActiveMQPropertyConversionException
-
putCharProperty
public CoreMessage putCharProperty(SimpleString key, char value)
- Specified by:
putCharPropertyin interfaceMessage
-
putCharProperty
public CoreMessage putCharProperty(String key, char value)
- Specified by:
putCharPropertyin interfaceMessage
-
putShortProperty
public CoreMessage putShortProperty(SimpleString key, short value)
- Specified by:
putShortPropertyin interfaceMessage
-
putShortProperty
public CoreMessage putShortProperty(String key, short value)
- Specified by:
putShortPropertyin interfaceMessage
-
putIntProperty
public CoreMessage putIntProperty(SimpleString key, int value)
- Specified by:
putIntPropertyin interfaceMessage
-
putIntProperty
public CoreMessage putIntProperty(String key, int value)
- Specified by:
putIntPropertyin interfaceMessage
-
getIntProperty
public Integer getIntProperty(SimpleString key) throws ActiveMQPropertyConversionException
- Specified by:
getIntPropertyin interfaceMessage- Throws:
ActiveMQPropertyConversionException
-
getIntProperty
public Integer getIntProperty(String key) throws ActiveMQPropertyConversionException
- Specified by:
getIntPropertyin interfaceMessage- Throws:
ActiveMQPropertyConversionException
-
putLongProperty
public CoreMessage putLongProperty(SimpleString key, long value)
- Specified by:
putLongPropertyin interfaceMessage
-
putLongProperty
public CoreMessage putLongProperty(String key, long value)
- Specified by:
putLongPropertyin interfaceMessage
-
getLongProperty
public Long getLongProperty(SimpleString key) throws ActiveMQPropertyConversionException
- Specified by:
getLongPropertyin interfaceMessage- Throws:
ActiveMQPropertyConversionException
-
getLongProperty
public Long getLongProperty(String key) throws ActiveMQPropertyConversionException
- Specified by:
getLongPropertyin interfaceMessage- Throws:
ActiveMQPropertyConversionException
-
putFloatProperty
public CoreMessage putFloatProperty(SimpleString key, float value)
- Specified by:
putFloatPropertyin interfaceMessage
-
putFloatProperty
public CoreMessage putFloatProperty(String key, float value)
- Specified by:
putFloatPropertyin interfaceMessage
-
putDoubleProperty
public CoreMessage putDoubleProperty(SimpleString key, double value)
- Specified by:
putDoublePropertyin interfaceMessage
-
putDoubleProperty
public CoreMessage putDoubleProperty(String key, double value)
- Specified by:
putDoublePropertyin interfaceMessage
-
getDoubleProperty
public Double getDoubleProperty(SimpleString key) throws ActiveMQPropertyConversionException
- Specified by:
getDoublePropertyin interfaceMessage- Throws:
ActiveMQPropertyConversionException
-
getDoubleProperty
public Double getDoubleProperty(String key) throws ActiveMQPropertyConversionException
- Specified by:
getDoublePropertyin interfaceMessage- Throws:
ActiveMQPropertyConversionException
-
putStringProperty
public CoreMessage putStringProperty(SimpleString key, SimpleString value)
- Specified by:
putStringPropertyin interfaceMessage
-
putStringProperty
public CoreMessage putStringProperty(SimpleString key, String value)
- Specified by:
putStringPropertyin interfaceMessage
-
putStringProperty
public CoreMessage putStringProperty(String key, String value)
Description copied from interface:MessagePuts a String property in this message.- Specified by:
putStringPropertyin interfaceMessage- Parameters:
key- property namevalue- property value
-
putObjectProperty
public CoreMessage putObjectProperty(SimpleString key, Object value) throws ActiveMQPropertyConversionException
- Specified by:
putObjectPropertyin interfaceMessage- Throws:
ActiveMQPropertyConversionException
-
getObjectProperty
public Object getObjectProperty(String key)
- Specified by:
getObjectPropertyin interfaceMessage
-
getObjectProperty
public Object getObjectProperty(SimpleString key)
- Specified by:
getObjectPropertyin interfaceMessage
-
putObjectProperty
public CoreMessage putObjectProperty(String key, Object value) throws ActiveMQPropertyConversionException
- Specified by:
putObjectPropertyin interfaceMessage- Throws:
ActiveMQPropertyConversionException
-
getShortProperty
public Short getShortProperty(SimpleString key) throws ActiveMQPropertyConversionException
- Specified by:
getShortPropertyin interfaceMessage- Throws:
ActiveMQPropertyConversionException
-
getShortProperty
public Short getShortProperty(String key) throws ActiveMQPropertyConversionException
- Specified by:
getShortPropertyin interfaceMessage- Throws:
ActiveMQPropertyConversionException
-
getFloatProperty
public Float getFloatProperty(SimpleString key) throws ActiveMQPropertyConversionException
- Specified by:
getFloatPropertyin interfaceMessage- Throws:
ActiveMQPropertyConversionException
-
getFloatProperty
public Float getFloatProperty(String key) throws ActiveMQPropertyConversionException
- Specified by:
getFloatPropertyin interfaceMessage- Throws:
ActiveMQPropertyConversionException
-
getStringProperty
public String getStringProperty(SimpleString key) throws ActiveMQPropertyConversionException
- Specified by:
getStringPropertyin interfaceMessage- Throws:
ActiveMQPropertyConversionException
-
getStringProperty
public String getStringProperty(String key) throws ActiveMQPropertyConversionException
- Specified by:
getStringPropertyin interfaceMessage- Throws:
ActiveMQPropertyConversionException
-
getSimpleStringProperty
public SimpleString getSimpleStringProperty(SimpleString key) throws ActiveMQPropertyConversionException
- Specified by:
getSimpleStringPropertyin interfaceMessage- Throws:
ActiveMQPropertyConversionException
-
getSimpleStringProperty
public SimpleString getSimpleStringProperty(String key) throws ActiveMQPropertyConversionException
- Specified by:
getSimpleStringPropertyin interfaceMessage- Throws:
ActiveMQPropertyConversionException
-
removeProperty
public Object removeProperty(SimpleString key)
- Specified by:
removePropertyin interfaceMessage
-
removeProperty
public Object removeProperty(String key)
- Specified by:
removePropertyin interfaceMessage
-
hasScheduledDeliveryTime
public boolean hasScheduledDeliveryTime()
Description copied from interface:MessageSearch for the existence of the property: an implementor can save the message to be decoded, if possible.- Specified by:
hasScheduledDeliveryTimein interfaceMessage
-
searchProperty
public boolean searchProperty(SimpleString key)
Differently fromcontainsProperty(SimpleString), this method can save decoding the message, performing a search of thekeyproperty and falling back tocontainsProperty(SimpleString)if not possible or if already decoded.
-
containsProperty
public boolean containsProperty(SimpleString key)
- Specified by:
containsPropertyin interfaceMessage
-
containsProperty
public boolean containsProperty(String key)
- Specified by:
containsPropertyin interfaceMessage
-
getPropertyNames
public Set<SimpleString> getPropertyNames()
Description copied from interface:MessageReturns all the names of the properties for this message.- Specified by:
getPropertyNamesin interfaceMessage
-
getLargeBodyReader
public LargeBodyReader getLargeBodyReader() throws ActiveMQException
- Specified by:
getLargeBodyReaderin interfaceICoreMessage- Throws:
ActiveMQException
-
getPersistSize
public int getPersistSize()
- Specified by:
getPersistSizein interfaceMessage
-
persist
public void persist(ActiveMQBuffer targetRecord)
-
reloadPersistence
public void reloadPersistence(ActiveMQBuffer record, CoreMessageObjectPools pools)
- Specified by:
reloadPersistencein interfaceMessage
-
toCore
public CoreMessage toCore()
Description copied from interface:MessageThis should make you convert your message into Core format.
-
toCore
public CoreMessage toCore(CoreMessageObjectPools coreMessageObjectPools)
Description copied from interface:MessageThis should make you convert your message into Core format.
-
getPersistentSize
public long getPersistentSize() throws ActiveMQExceptionDescription copied from interface:MessageThis is the size of the message when persisted on disk which is used for metrics tracking Note that even if the message itself is not persisted on disk (ie non-durable) this value is still used for metrics tracking If a normal message it will be the encoded message size If a large message it will be encoded message size + large message body size- Specified by:
getPersistentSizein interfaceMessage- Returns:
- Throws:
ActiveMQException
-
getStringBody
public String getStringBody()
- Specified by:
getStringBodyin interfaceMessage
-
toCompositeData
public CompositeData toCompositeData(int fieldsLimit, int deliveryCount) throws OpenDataException
- Specified by:
toCompositeDatain interfaceMessage- Throws:
OpenDataException
-
-