public class CoreMessage extends RefCountMessage implements ICoreMessage
| Modifier and Type | Field and Description |
|---|---|
protected SimpleString |
address |
static int |
BODY_OFFSET |
protected io.netty.buffer.ByteBuf |
buffer
That is the encode for the whole message, including properties..
|
static int |
BUFFER_HEADER_SPACE |
protected boolean |
durable |
protected int |
endOfBodyPosition |
protected long |
messageID |
protected int |
messageIDPosition |
protected byte |
priority |
protected TypedProperties |
properties |
protected long |
timestamp |
protected byte |
type |
protected ResetLimitWrappedActiveMQBuffer |
writableBuffer |
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_LARGE_BODY_SIZE, HDR_LARGE_COMPRESSED, HDR_LAST_VALUE_NAME, HDR_ORIG_MESSAGE_ID, 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, MAP_TYPE, memoryOffset, OBJECT_TYPE, STREAM_TYPE, TEXT_TYPE| Modifier | Constructor and Description |
|---|---|
|
CoreMessage() |
protected |
CoreMessage(CoreMessage other) |
|
CoreMessage(CoreMessageObjectPools coreMessageObjectPools) |
protected |
CoreMessage(CoreMessage other,
TypedProperties copyProperties) |
|
CoreMessage(long id,
int bufferSize) |
|
CoreMessage(long id,
int bufferSize,
CoreMessageObjectPools coreMessageObjectPools) |
| Modifier and Type | Method and Description |
|---|---|
protected void |
checkEncode() |
protected TypedProperties |
checkProperties()
I am keeping this synchronized as the decode of the Properties is lazy
|
void |
cleanupInternalProperties() |
boolean |
containsProperty(SimpleString key) |
boolean |
containsProperty(String key) |
Message |
copy()
It will generate a new instance of the message encode, being a deep copy, new properties, new everything
|
Message |
copy(long newID)
It will generate a new instance of the message encode, being a deep copy, new properties, new everything
|
void |
copyHeadersAndProperties(Message msg)
Used on large messages treatment
|
void |
decodeHeadersAndProperties(io.netty.buffer.ByteBuf buffer) |
CoreMessage |
encode() |
void |
encodeHeadersAndProperties(io.netty.buffer.ByteBuf buffer) |
String |
getAddress() |
SimpleString |
getAddressSimpleString() |
Object |
getAnnotation(SimpleString key)
On core there's no delivery annotation
|
ActiveMQBuffer |
getBodyBuffer()
The body used for this message.
|
LargeBodyEncoder |
getBodyEncoder() |
InputStream |
getBodyInputStream() |
Boolean |
getBooleanProperty(SimpleString key) |
Boolean |
getBooleanProperty(String key) |
io.netty.buffer.ByteBuf |
getBuffer() |
Byte |
getByteProperty(SimpleString key) |
Byte |
getByteProperty(String key) |
byte[] |
getBytesProperty(SimpleString key) |
byte[] |
getBytesProperty(String key) |
ActiveMQBuffer |
getDataBuffer()
This will return the proper buffer to represent the data of the Message.
|
Double |
getDoubleProperty(SimpleString key) |
Double |
getDoubleProperty(String key) |
Object |
getDuplicateProperty() |
int |
getEncodeSize()
Returns the size of the encoded message.
|
int |
getEndOfBodyPosition() |
long |
getExpiration()
Returns the expiration time of this message.
|
Float |
getFloatProperty(SimpleString key) |
Float |
getFloatProperty(String key) |
SimpleString |
getGroupID() |
int |
getHeadersAndPropertiesEncodeSize() |
Integer |
getIntProperty(SimpleString key) |
Integer |
getIntProperty(String key) |
SimpleString |
getLastValueProperty() |
Long |
getLongProperty(SimpleString key) |
Long |
getLongProperty(String key) |
int |
getMemoryEstimate() |
long |
getMessageID()
Returns the messageID.
|
Object |
getObjectProperty(SimpleString key) |
Object |
getObjectProperty(String key) |
long |
getPersistentSize()
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 size
|
Persister<Message> |
getPersister() |
int |
getPersistSize() |
byte |
getPriority()
Returns the message priority.
|
Set<SimpleString> |
getPropertyNames()
Returns all the names of the properties for this message.
|
ActiveMQBuffer |
getReadOnlyBodyBuffer()
Returns a new Buffer slicing the current Body.
|
SimpleString |
getReplyTo() |
RoutingType |
getRoutingType() |
Long |
getScheduledDeliveryTime()
Used to calculate what is the delivery time.
|
Short |
getShortProperty(SimpleString key) |
Short |
getShortProperty(String key) |
SimpleString |
getSimpleStringProperty(SimpleString key) |
SimpleString |
getSimpleStringProperty(String key) |
String |
getStringProperty(SimpleString key) |
String |
getStringProperty(String key) |
long |
getTimestamp() |
byte |
getType()
Return the type of the message
|
TypedProperties |
getTypedProperties() |
UUID |
getUserID()
This represents historically the JMSMessageID.
|
String |
getValidatedUserID() |
CoreMessage |
initBuffer(int initialMessageBufferSize) |
boolean |
isDurable()
Returns whether this message is durable or not.
|
boolean |
isLargeMessage() |
boolean |
isServerMessage()
We are really interested if this is a LargeServerMessage.
|
void |
messageChanged() |
void |
persist(ActiveMQBuffer targetRecord) |
CoreMessage |
putBooleanProperty(SimpleString key,
boolean value) |
CoreMessage |
putBooleanProperty(String key,
boolean value) |
CoreMessage |
putByteProperty(SimpleString key,
byte value) |
CoreMessage |
putByteProperty(String key,
byte value) |
CoreMessage |
putBytesProperty(SimpleString key,
byte[] value) |
CoreMessage |
putBytesProperty(String key,
byte[] value) |
CoreMessage |
putCharProperty(SimpleString key,
char value) |
CoreMessage |
putCharProperty(String key,
char value) |
CoreMessage |
putDoubleProperty(SimpleString key,
double value) |
CoreMessage |
putDoubleProperty(String key,
double value) |
CoreMessage |
putFloatProperty(SimpleString key,
float value) |
CoreMessage |
putFloatProperty(String key,
float value) |
CoreMessage |
putIntProperty(SimpleString key,
int value) |
CoreMessage |
putIntProperty(String key,
int value) |
CoreMessage |
putLongProperty(SimpleString key,
long value) |
CoreMessage |
putLongProperty(String key,
long value) |
CoreMessage |
putObjectProperty(SimpleString key,
Object value) |
CoreMessage |
putObjectProperty(String key,
Object value) |
CoreMessage |
putShortProperty(SimpleString key,
short value) |
CoreMessage |
putShortProperty(String key,
short value) |
CoreMessage |
putStringProperty(SimpleString key,
SimpleString value) |
CoreMessage |
putStringProperty(SimpleString key,
String value) |
CoreMessage |
putStringProperty(String key,
String value)
Puts a String property in this message.
|
void |
receiveBuffer_1X(io.netty.buffer.ByteBuf buffer)
This will fix the incoming body of 1.x messages
|
void |
receiveBuffer(io.netty.buffer.ByteBuf buffer)
Used to receive this message from an encoded medium buffer
|
void |
reloadPersistence(ActiveMQBuffer record) |
Object |
removeAnnotation(SimpleString key)
On core there's no delivery annotation
|
Object |
removeProperty(SimpleString key) |
Object |
removeProperty(String key) |
void |
sendBuffer_1X(io.netty.buffer.ByteBuf sendBuffer)
Recast the message as an 1.4 message
|
void |
sendBuffer(io.netty.buffer.ByteBuf sendBuffer,
int deliveryCount)
Used to send this message to an encoded medium buffer.
|
CoreMessage |
setAddress(SimpleString address)
This will set the address on CoreMessage.
|
CoreMessage |
setAddress(String address)
Look at
Message.setAddress(SimpleString) for the doc. |
CoreMessage |
setBuffer(io.netty.buffer.ByteBuf buffer)
The buffer will belong to this message, until release is called.
|
CoreMessage |
setDurable(boolean durable)
Sets whether this message is durable or not.
|
CoreMessage |
setExpiration(long expiration)
Sets the expiration of this message.
|
Message |
setLastValueProperty(SimpleString lastValueName) |
CoreMessage |
setMessageID(long messageID) |
CoreMessage |
setPriority(byte priority)
Sets the message priority.
|
CoreMessage |
setReplyTo(SimpleString address) |
Message |
setRoutingType(RoutingType routingType) |
CoreMessage |
setScheduledDeliveryTime(Long time) |
CoreMessage |
setTimestamp(long timestamp) |
CoreMessage |
setType(byte type)
the type of the message
|
CoreMessage |
setUserID(Object uuid) |
CoreMessage |
setUserID(UUID userID) |
CoreMessage |
setValidatedUserID(String validatedUserID) |
CoreMessage |
toCore()
This should make you convert your message into Core format.
|
CoreMessage |
toCore(CoreMessageObjectPools coreMessageObjectPools)
This should make you convert your message into Core format.
|
String |
toString() |
decrementDurableRefCount, decrementRefCount, getContext, getRefCount, incrementDurableRefCount, incrementRefCount, setContextclone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waittoMapacceptsConsumer, decrementDurableRefCount, decrementRefCount, getAnnotationString, getConnectionID, getContext, getDuplicateIDBytes, getExtraBytesProperty, getRefCount, incrementDurableRefCount, incrementRefCount, isExpired, putExtraBytesProperty, reencode, referenceOriginalMessage, rejectConsumer, releaseBuffer, removeExtraBytesProperty, setAnnotation, setConnectionID, setContext, toPropertyMappublic static final int BUFFER_HEADER_SPACE
public static final int BODY_OFFSET
protected io.netty.buffer.ByteBuf buffer
protected volatile ResetLimitWrappedActiveMQBuffer writableBuffer
protected int endOfBodyPosition
protected int messageIDPosition
protected long messageID
protected SimpleString address
protected byte type
protected boolean durable
protected long timestamp
protected byte priority
protected volatile TypedProperties properties
public CoreMessage(CoreMessageObjectPools coreMessageObjectPools)
public CoreMessage()
protected CoreMessage(CoreMessage other)
public CoreMessage(long id,
int bufferSize)
public CoreMessage(long id,
int bufferSize,
CoreMessageObjectPools coreMessageObjectPools)
protected CoreMessage(CoreMessage other, TypedProperties copyProperties)
public Object getAnnotation(SimpleString key)
getAnnotation in interface Messagepublic Object removeAnnotation(SimpleString key)
removeAnnotation in interface Messagepublic void cleanupInternalProperties()
cleanupInternalProperties in interface Messagepublic Persister<Message> getPersister()
getPersister in interface Messagepublic CoreMessage initBuffer(int initialMessageBufferSize)
public SimpleString getReplyTo()
getReplyTo in interface Messagepublic RoutingType getRoutingType()
getRoutingType in interface Messagepublic Message setRoutingType(RoutingType routingType)
setRoutingType in interface Messagepublic CoreMessage setReplyTo(SimpleString address)
setReplyTo in interface Messagepublic void receiveBuffer(io.netty.buffer.ByteBuf buffer)
MessagereceiveBuffer in interface Messagepublic void receiveBuffer_1X(io.netty.buffer.ByteBuf buffer)
receiveBuffer_1X in interface ICoreMessagepublic ActiveMQBuffer getReadOnlyBodyBuffer()
ICoreMessagegetReadOnlyBodyBuffer in interface ICoreMessagepublic ActiveMQBuffer getDataBuffer()
getDataBuffer in interface ICoreMessageActiveMQExceptionpublic SimpleString getGroupID()
getGroupID in interface Messagepublic void sendBuffer(io.netty.buffer.ByteBuf sendBuffer,
int deliveryCount)
MessagesendBuffer in interface MessagesendBuffer - deliveryCount - Some protocols (AMQP) will have this as part of the message. ignored on corepublic void sendBuffer_1X(io.netty.buffer.ByteBuf sendBuffer)
sendBuffer_1X in interface ICoreMessageprotected void checkEncode()
public Long getScheduledDeliveryTime()
MessagegetScheduledDeliveryTime in interface Messagepublic CoreMessage setScheduledDeliveryTime(Long time)
setScheduledDeliveryTime in interface Messagepublic InputStream getBodyInputStream()
getBodyInputStream in interface ICoreMessagegetBodyInputStream in interface Messagepublic ActiveMQBuffer getBodyBuffer()
getBodyBuffer in interface ICoreMessagegetBodyBuffer in interface Messagepublic int getEndOfBodyPosition()
getEndOfBodyPosition in interface ICoreMessagepublic TypedProperties getTypedProperties()
public void messageChanged()
messageChanged in interface Messagepublic void copyHeadersAndProperties(Message msg)
ICoreMessagecopyHeadersAndProperties in interface ICoreMessagepublic Message copy()
Messagepublic Message copy(long newID)
Messagepublic long getExpiration()
MessagegetExpiration in interface Messagepublic long getTimestamp()
getTimestamp in interface Messagepublic CoreMessage setTimestamp(long timestamp)
setTimestamp in interface Messagepublic long getMessageID()
MessagegetMessageID in interface Messagepublic byte getPriority()
MessageValues range from 0 (less priority) to 9 (more priority) inclusive.
getPriority in interface Messagepublic UUID getUserID()
Messagepublic CoreMessage setUserID(Object uuid)
public String getValidatedUserID()
getValidatedUserID in interface Messagepublic CoreMessage setValidatedUserID(String validatedUserID)
setValidatedUserID in interface Messagepublic CoreMessage setMessageID(long messageID)
setMessageID in interface Messagepublic CoreMessage setAddress(SimpleString address)
MessagesetAddress in interface Messagepublic SimpleString getAddressSimpleString()
getAddressSimpleString in interface Messagepublic CoreMessage setExpiration(long expiration)
MessagesetExpiration in interface Messageexpiration - expiration timepublic CoreMessage setPriority(byte priority)
MessageValue must be between 0 and 9 inclusive.
setPriority in interface Messagepriority - the new message prioritypublic CoreMessage setUserID(UUID userID)
protected TypedProperties checkProperties()
public int getMemoryEstimate()
getMemoryEstimate in interface Messagepublic boolean isServerMessage()
ICoreMessageisServerMessage in interface ICoreMessagepublic byte getType()
ICoreMessagegetType in interface ICoreMessagegetType in interface Messagepublic CoreMessage setType(byte type)
ICoreMessagesetType in interface ICoreMessagesetType in interface Messagepublic void decodeHeadersAndProperties(io.netty.buffer.ByteBuf buffer)
public CoreMessage encode()
public void encodeHeadersAndProperties(io.netty.buffer.ByteBuf buffer)
public int getHeadersAndPropertiesEncodeSize()
getHeadersAndPropertiesEncodeSize in interface ICoreMessagepublic Object getDuplicateProperty()
getDuplicateProperty in interface Messagepublic SimpleString getLastValueProperty()
getLastValueProperty in interface Messagepublic Message setLastValueProperty(SimpleString lastValueName)
setLastValueProperty in interface Messagepublic int getEncodeSize()
MessagegetEncodeSize in interface Messagepublic boolean isLargeMessage()
isLargeMessage in interface Messagepublic String getAddress()
getAddress in interface Messagepublic CoreMessage setAddress(String address)
MessageMessage.setAddress(SimpleString) for the doc.setAddress in interface Messagepublic CoreMessage setBuffer(io.netty.buffer.ByteBuf buffer)
Messagepublic boolean isDurable()
Messagepublic CoreMessage setDurable(boolean durable)
MessagesetDurable in interface Messagedurable - true to flag this message as durable, false elsepublic CoreMessage putBooleanProperty(String key, boolean value)
putBooleanProperty in interface Messagepublic CoreMessage putBooleanProperty(SimpleString key, boolean value)
putBooleanProperty in interface Messagepublic Boolean getBooleanProperty(SimpleString key) throws ActiveMQPropertyConversionException
getBooleanProperty in interface MessageActiveMQPropertyConversionExceptionpublic Boolean getBooleanProperty(String key) throws ActiveMQPropertyConversionException
getBooleanProperty in interface MessageActiveMQPropertyConversionExceptionpublic CoreMessage putByteProperty(SimpleString key, byte value)
putByteProperty in interface Messagepublic CoreMessage putByteProperty(String key, byte value)
putByteProperty in interface Messagepublic Byte getByteProperty(SimpleString key) throws ActiveMQPropertyConversionException
getByteProperty in interface MessageActiveMQPropertyConversionExceptionpublic Byte getByteProperty(String key) throws ActiveMQPropertyConversionException
getByteProperty in interface MessageActiveMQPropertyConversionExceptionpublic CoreMessage putBytesProperty(SimpleString key, byte[] value)
putBytesProperty in interface Messagepublic CoreMessage putBytesProperty(String key, byte[] value)
putBytesProperty in interface Messagepublic byte[] getBytesProperty(SimpleString key) throws ActiveMQPropertyConversionException
getBytesProperty in interface MessageActiveMQPropertyConversionExceptionpublic byte[] getBytesProperty(String key) throws ActiveMQPropertyConversionException
getBytesProperty in interface MessageActiveMQPropertyConversionExceptionpublic CoreMessage putCharProperty(SimpleString key, char value)
putCharProperty in interface Messagepublic CoreMessage putCharProperty(String key, char value)
putCharProperty in interface Messagepublic CoreMessage putShortProperty(SimpleString key, short value)
putShortProperty in interface Messagepublic CoreMessage putShortProperty(String key, short value)
putShortProperty in interface Messagepublic CoreMessage putIntProperty(SimpleString key, int value)
putIntProperty in interface Messagepublic CoreMessage putIntProperty(String key, int value)
putIntProperty in interface Messagepublic Integer getIntProperty(SimpleString key) throws ActiveMQPropertyConversionException
getIntProperty in interface MessageActiveMQPropertyConversionExceptionpublic Integer getIntProperty(String key) throws ActiveMQPropertyConversionException
getIntProperty in interface MessageActiveMQPropertyConversionExceptionpublic CoreMessage putLongProperty(SimpleString key, long value)
putLongProperty in interface Messagepublic CoreMessage putLongProperty(String key, long value)
putLongProperty in interface Messagepublic Long getLongProperty(SimpleString key) throws ActiveMQPropertyConversionException
getLongProperty in interface MessageActiveMQPropertyConversionExceptionpublic Long getLongProperty(String key) throws ActiveMQPropertyConversionException
getLongProperty in interface MessageActiveMQPropertyConversionExceptionpublic CoreMessage putFloatProperty(SimpleString key, float value)
putFloatProperty in interface Messagepublic CoreMessage putFloatProperty(String key, float value)
putFloatProperty in interface Messagepublic CoreMessage putDoubleProperty(SimpleString key, double value)
putDoubleProperty in interface Messagepublic CoreMessage putDoubleProperty(String key, double value)
putDoubleProperty in interface Messagepublic Double getDoubleProperty(SimpleString key) throws ActiveMQPropertyConversionException
getDoubleProperty in interface MessageActiveMQPropertyConversionExceptionpublic Double getDoubleProperty(String key) throws ActiveMQPropertyConversionException
getDoubleProperty in interface MessageActiveMQPropertyConversionExceptionpublic CoreMessage putStringProperty(SimpleString key, SimpleString value)
putStringProperty in interface Messagepublic CoreMessage putStringProperty(SimpleString key, String value)
putStringProperty in interface Messagepublic CoreMessage putStringProperty(String key, String value)
MessageputStringProperty in interface Messagekey - property namevalue - property valuepublic CoreMessage putObjectProperty(SimpleString key, Object value) throws ActiveMQPropertyConversionException
putObjectProperty in interface MessageActiveMQPropertyConversionExceptionpublic Object getObjectProperty(String key)
getObjectProperty in interface Messagepublic Object getObjectProperty(SimpleString key)
getObjectProperty in interface Messagepublic CoreMessage putObjectProperty(String key, Object value) throws ActiveMQPropertyConversionException
putObjectProperty in interface MessageActiveMQPropertyConversionExceptionpublic Short getShortProperty(SimpleString key) throws ActiveMQPropertyConversionException
getShortProperty in interface MessageActiveMQPropertyConversionExceptionpublic Short getShortProperty(String key) throws ActiveMQPropertyConversionException
getShortProperty in interface MessageActiveMQPropertyConversionExceptionpublic Float getFloatProperty(SimpleString key) throws ActiveMQPropertyConversionException
getFloatProperty in interface MessageActiveMQPropertyConversionExceptionpublic Float getFloatProperty(String key) throws ActiveMQPropertyConversionException
getFloatProperty in interface MessageActiveMQPropertyConversionExceptionpublic String getStringProperty(SimpleString key) throws ActiveMQPropertyConversionException
getStringProperty in interface MessageActiveMQPropertyConversionExceptionpublic String getStringProperty(String key) throws ActiveMQPropertyConversionException
getStringProperty in interface MessageActiveMQPropertyConversionExceptionpublic SimpleString getSimpleStringProperty(SimpleString key) throws ActiveMQPropertyConversionException
getSimpleStringProperty in interface MessageActiveMQPropertyConversionExceptionpublic SimpleString getSimpleStringProperty(String key) throws ActiveMQPropertyConversionException
getSimpleStringProperty in interface MessageActiveMQPropertyConversionExceptionpublic Object removeProperty(SimpleString key)
removeProperty in interface Messagepublic Object removeProperty(String key)
removeProperty in interface Messagepublic boolean containsProperty(SimpleString key)
containsProperty in interface Messagepublic boolean containsProperty(String key)
containsProperty in interface Messagepublic Set<SimpleString> getPropertyNames()
MessagegetPropertyNames in interface Messagepublic LargeBodyEncoder getBodyEncoder() throws ActiveMQException
getBodyEncoder in interface ICoreMessageActiveMQExceptionpublic int getPersistSize()
getPersistSize in interface Messagepublic void persist(ActiveMQBuffer targetRecord)
public void reloadPersistence(ActiveMQBuffer record)
reloadPersistence in interface Messagepublic CoreMessage toCore()
Messagepublic CoreMessage toCore(CoreMessageObjectPools coreMessageObjectPools)
Messagepublic long getPersistentSize()
throws ActiveMQException
MessagegetPersistentSize in interface MessageActiveMQExceptionCopyright © 2019 JBoss by Red Hat. All rights reserved.