public class ClientMessageImpl extends CoreMessage implements ClientMessageInternal
Modifier and Type | Field and Description |
---|---|
static SimpleString |
REPLYTO_HEADER_NAME |
address, BODY_OFFSET, buffer, BUFFER_HEADER_SPACE, durable, endOfBodyPosition, messageID, messageIDPosition, priority, properties, timestamp, type, 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_GROUP_SEQUENCE, 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 |
---|---|
|
ClientMessageImpl() |
|
ClientMessageImpl(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) |
protected |
ClientMessageImpl(ClientMessageImpl other) |
|
ClientMessageImpl(CoreMessageObjectPools coreMessageObjectPools) |
Modifier and Type | Method and Description |
---|---|
ClientMessageImpl |
acknowledge()
Acknowledges reception of this message.
|
void |
checkCompletion()
This can be optionally used to verify if the entire message has been received.
|
Message |
copy()
It will generate a new instance of the message encode, being a deep copy, new properties, new everything
|
void |
discardBody()
Discard unused packets (used on large-message)
|
LargeBodyEncoder |
getBodyEncoder() |
InputStream |
getBodyInputStream()
Return the bodyInputStream for large messages
|
int |
getBodySize()
Returns the size (in bytes) of this message's body
|
int |
getDeliveryCount()
Returns the number of times this message was delivered.
|
int |
getFlowControlSize()
Size used for FlowControl
|
ClientMessageImpl |
individualAcknowledge()
Acknowledges reception of a single message.
|
boolean |
isCompressed() |
boolean |
isLargeMessage() |
void |
onReceipt(ClientConsumerInternal consumer) |
ClientMessageImpl |
putBooleanProperty(SimpleString key,
boolean value)
Overridden from
Message to enable fluent API |
ClientMessageImpl |
putBooleanProperty(String key,
boolean value)
Overridden from
Message to enable fluent API |
ClientMessageImpl |
putByteProperty(SimpleString key,
byte value)
Overridden from
Message to enable fluent API |
ClientMessageImpl |
putByteProperty(String key,
byte value)
Overridden from
Message to enable fluent API |
ClientMessageImpl |
putBytesProperty(SimpleString key,
byte[] value)
Overridden from
Message to enable fluent API |
ClientMessageImpl |
putBytesProperty(String key,
byte[] value)
Overridden from
Message to enable fluent API |
ClientMessageImpl |
putCharProperty(SimpleString key,
char value)
Overridden from
Message to enable fluent API |
ClientMessageImpl |
putCharProperty(String key,
char value)
Overridden from
Message to enable fluent API |
ClientMessageImpl |
putDoubleProperty(SimpleString key,
double value)
Overridden from
Message to enable fluent API |
ClientMessageImpl |
putDoubleProperty(String key,
double value)
Overridden from
Message to enable fluent API |
ClientMessageImpl |
putFloatProperty(SimpleString key,
float value)
Overridden from
Message to enable fluent API |
ClientMessageImpl |
putFloatProperty(String key,
float value)
Overridden from
Message to enable fluent API |
ClientMessageImpl |
putIntProperty(SimpleString key,
int value)
Overridden from
Message to enable fluent API |
ClientMessageImpl |
putIntProperty(String key,
int value)
Overridden from
Message to enable fluent API |
ClientMessageImpl |
putLongProperty(SimpleString key,
long value)
Overridden from
Message to enable fluent API |
ClientMessageImpl |
putLongProperty(String key,
long value)
Overridden from
Message to enable fluent API |
ClientMessageImpl |
putObjectProperty(SimpleString key,
Object value) |
ClientMessageImpl |
putObjectProperty(String key,
Object value) |
ClientMessageImpl |
putShortProperty(SimpleString key,
short value)
Overridden from
Message to enable fluent API |
ClientMessageImpl |
putShortProperty(String key,
short value)
Overridden from
Message to enable fluent API |
ClientMessageImpl |
putStringProperty(SimpleString key,
SimpleString value) |
ClientMessageImpl |
putStringProperty(SimpleString key,
String value) |
ClientMessageImpl |
putStringProperty(String key,
String value)
Puts a String property in this message.
|
void |
saveToOutputStream(OutputStream out)
Saves the content of the message to the OutputStream.
|
ClientMessageImpl |
setBodyInputStream(InputStream bodyInputStream)
Sets the body's IntputStream.
|
ClientMessageImpl |
setDeliveryCount(int deliveryCount)
Sets the delivery count for this message.
|
ClientMessageImpl |
setDurable(boolean durable)
Sets whether this message is durable or not.
|
ClientMessageImpl |
setExpiration(long expiration)
Sets the expiration of this message.
|
void |
setFlowControlSize(int flowControlSize)
Size used for FlowControl
|
ClientMessageImpl |
setOutputStream(OutputStream out)
Sets the OutputStream that will receive the content of a message received in a non blocking way.
|
ClientMessageImpl |
setPriority(byte priority)
Sets the message priority.
|
ClientMessageImpl |
setUserID(UUID userID) |
String |
toString() |
boolean |
waitOutputStreamCompletion(long timeMilliseconds)
Wait the outputStream completion of the message.
|
ClientMessageImpl |
writeBodyBufferBytes(byte[] bytes)
Overridden from
Message to enable fluent API |
ClientMessageImpl |
writeBodyBufferString(String string)
Overridden from
Message to enable fluent API |
checkEncode, clearInternalProperties, containsProperty, containsProperty, copy, copyHeadersAndProperties, 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, getPersistentSize, getPersister, getPersistSize, getPriority, getProperties, getPropertyNames, getReadOnlyBodyBuffer, getReplyTo, getRoutingType, getScheduledDeliveryTime, getShortProperty, getShortProperty, getSimpleStringProperty, getSimpleStringProperty, getStringProperty, getStringProperty, getTimestamp, getType, getUserID, getValidatedUserID, initBuffer, isDurable, isServerMessage, messageChanged, persist, receiveBuffer_1X, receiveBuffer, reloadPersistence, removeAnnotation, removeProperty, removeProperty, sendBuffer_1X, sendBuffer, setAddress, setAddress, setBuffer, setCorrelationID, setGroupID, setGroupID, setGroupSequence, setLastValueProperty, setMessageID, setReplyTo, setRoutingType, setScheduledDeliveryTime, setTimestamp, setType, setUserID, setValidatedUserID, toCore, toCore
decrementDurableRefCount, decrementRefCount, getContext, getRefCount, incrementDurableRefCount, incrementRefCount, setContext
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
getProperties
getBodyBuffer
copyHeadersAndProperties, getBodyBufferSize, getDataBuffer, getEndOfBodyPosition, getHeadersAndPropertiesEncodeSize, getReadOnlyBodyBuffer, getType, isServerMessage, receiveBuffer_1X, sendBuffer_1X, setType, toMap
acceptsConsumer, clearInternalProperties, containsProperty, containsProperty, copy, decrementDurableRefCount, decrementRefCount, getAddress, getAddressSimpleString, getAnnotation, getAnnotationString, getBooleanProperty, getBooleanProperty, getBuffer, getByteProperty, getByteProperty, getBytesProperty, getBytesProperty, getConnectionID, getContext, getCorrelationID, getDoubleProperty, getDoubleProperty, getDuplicateIDBytes, getDuplicateProperty, getEncodeSize, getExpiration, getExtraBytesProperty, getFloatProperty, getFloatProperty, getGroupID, getGroupSequence, getIntProperty, getIntProperty, getLastValueProperty, getLongProperty, getLongProperty, getMemoryEstimate, getMessageID, getObjectProperty, getObjectProperty, getPersistentSize, getPersister, getPersistSize, getPriority, getPropertyNames, getRefCount, getReplyTo, getRoutingType, getScheduledDeliveryTime, getShortProperty, getShortProperty, getSimpleStringProperty, getSimpleStringProperty, getStringProperty, getStringProperty, getTimestamp, getUserID, getValidatedUserID, incrementDurableRefCount, incrementRefCount, isDurable, isExpired, messageChanged, persist, putExtraBytesProperty, receiveBuffer, reencode, referenceOriginalMessage, rejectConsumer, releaseBuffer, reloadPersistence, removeAnnotation, removeExtraBytesProperty, removeProperty, removeProperty, sendBuffer, setAddress, setAddress, setAnnotation, setBuffer, setConnectionID, setContext, setCorrelationID, setGroupID, setGroupID, setGroupSequence, setLastValueProperty, setMessageID, setReplyTo, setRoutingType, setScheduledDeliveryTime, setTimestamp, setUserID, setValidatedUserID, toCore, toCore, toPropertyMap
public static final SimpleString REPLYTO_HEADER_NAME
public ClientMessageImpl()
public ClientMessageImpl(CoreMessageObjectPools coreMessageObjectPools)
protected ClientMessageImpl(ClientMessageImpl other)
public ClientMessageImpl(byte type, boolean durable, long expiration, long timestamp, byte priority, int initialMessageBufferSize, CoreMessageObjectPools coreMessageObjectPools)
public ClientMessageImpl(byte type, boolean durable, long expiration, long timestamp, byte priority, int initialMessageBufferSize)
public ClientMessageImpl setDurable(boolean durable)
Message
setDurable
in interface Message
setDurable
in class CoreMessage
durable
- true
to flag this message as durable, false
elsepublic ClientMessageImpl setExpiration(long expiration)
Message
setExpiration
in interface Message
setExpiration
in class CoreMessage
expiration
- expiration timepublic ClientMessageImpl setPriority(byte priority)
Message
Value must be between 0 and 9 inclusive.
setPriority
in interface Message
setPriority
in class CoreMessage
priority
- the new message prioritypublic ClientMessageImpl setUserID(UUID userID)
setUserID
in class CoreMessage
public void onReceipt(ClientConsumerInternal consumer)
onReceipt
in interface ClientMessageInternal
public ClientMessageImpl setDeliveryCount(int deliveryCount)
ClientMessage
This method is not meant to be called by ActiveMQ Artemis clients.
setDeliveryCount
in interface ClientMessage
deliveryCount
- message delivery countpublic int getDeliveryCount()
ClientMessage
getDeliveryCount
in interface ClientMessage
public ClientMessageImpl acknowledge() throws ActiveMQException
ClientMessage
If the session responsible to acknowledge this message has autoCommitAcks
set to
true
, the transaction will automatically commit the current transaction. Otherwise,
this acknowledgement will not be committed until the client commits the session transaction.
acknowledge
in interface ClientMessage
ActiveMQException
- if an error occurred while acknowledging the message.ClientSession.isAutoCommitAcks()
public ClientMessageImpl individualAcknowledge() throws ActiveMQException
ClientMessage
If the session responsible to acknowledge this message has autoCommitAcks
set to
true
, the transaction will automatically commit the current transaction. Otherwise,
this acknowledgement will not be committed until the client commits the session transaction.
individualAcknowledge
in interface ClientMessage
ActiveMQException
- if an error occurred while acknowledging the message.ClientSession.isAutoCommitAcks()
public void checkCompletion() throws ActiveMQException
ClientMessage
checkCompletion
in interface ClientMessage
ActiveMQException
public int getFlowControlSize()
ClientMessageInternal
getFlowControlSize
in interface ClientMessageInternal
public void setFlowControlSize(int flowControlSize)
ClientMessageInternal
setFlowControlSize
in interface ClientMessageInternal
public boolean isLargeMessage()
isLargeMessage
in interface Message
isLargeMessage
in class CoreMessage
public boolean isCompressed()
isCompressed
in interface ClientMessageInternal
public int getBodySize()
ClientMessage
getBodySize
in interface ClientMessage
public String toString()
toString
in class CoreMessage
public void saveToOutputStream(OutputStream out) throws ActiveMQException
ClientMessage
saveToOutputStream
in interface ClientMessage
ActiveMQException
public ClientMessageImpl setOutputStream(OutputStream out) throws ActiveMQException
ClientMessage
setOutputStream
in interface ClientMessage
ActiveMQException
public boolean waitOutputStreamCompletion(long timeMilliseconds) throws ActiveMQException
ClientMessage
waitOutputStreamCompletion
in interface ClientMessage
timeMilliseconds
- - 0 means wait foreverActiveMQException
public void discardBody()
ClientMessageInternal
discardBody
in interface ClientMessageInternal
public InputStream getBodyInputStream()
ClientMessage
getBodyInputStream
in interface ClientMessage
getBodyInputStream
in interface ICoreMessage
getBodyInputStream
in interface Message
getBodyInputStream
in class CoreMessage
public ClientMessageImpl setBodyInputStream(InputStream bodyInputStream)
ClientMessage
setBodyInputStream
in interface ClientMessage
bodyInputStream
- the bodyInputStream to setpublic LargeBodyEncoder getBodyEncoder() throws ActiveMQException
getBodyEncoder
in interface ICoreMessage
getBodyEncoder
in class CoreMessage
ActiveMQException
public ClientMessageImpl putBooleanProperty(SimpleString key, boolean value)
ClientMessage
Message
to enable fluent APIputBooleanProperty
in interface ClientMessage
putBooleanProperty
in interface Message
putBooleanProperty
in class CoreMessage
public ClientMessageImpl putByteProperty(SimpleString key, byte value)
ClientMessage
Message
to enable fluent APIputByteProperty
in interface ClientMessage
putByteProperty
in interface Message
putByteProperty
in class CoreMessage
public ClientMessageImpl putBytesProperty(SimpleString key, byte[] value)
ClientMessage
Message
to enable fluent APIputBytesProperty
in interface ClientMessage
putBytesProperty
in interface Message
putBytesProperty
in class CoreMessage
public ClientMessageImpl putCharProperty(SimpleString key, char value)
ClientMessage
Message
to enable fluent APIputCharProperty
in interface ClientMessage
putCharProperty
in interface Message
putCharProperty
in class CoreMessage
public ClientMessageImpl putCharProperty(String key, char value)
ClientMessage
Message
to enable fluent APIputCharProperty
in interface ClientMessage
putCharProperty
in interface Message
putCharProperty
in class CoreMessage
public ClientMessageImpl putShortProperty(SimpleString key, short value)
ClientMessage
Message
to enable fluent APIputShortProperty
in interface ClientMessage
putShortProperty
in interface Message
putShortProperty
in class CoreMessage
public ClientMessageImpl putIntProperty(SimpleString key, int value)
ClientMessage
Message
to enable fluent APIputIntProperty
in interface ClientMessage
putIntProperty
in interface Message
putIntProperty
in class CoreMessage
public ClientMessageImpl putLongProperty(SimpleString key, long value)
ClientMessage
Message
to enable fluent APIputLongProperty
in interface ClientMessage
putLongProperty
in interface Message
putLongProperty
in class CoreMessage
public ClientMessageImpl putFloatProperty(SimpleString key, float value)
ClientMessage
Message
to enable fluent APIputFloatProperty
in interface ClientMessage
putFloatProperty
in interface Message
putFloatProperty
in class CoreMessage
public ClientMessageImpl putDoubleProperty(SimpleString key, double value)
ClientMessage
Message
to enable fluent APIputDoubleProperty
in interface ClientMessage
putDoubleProperty
in interface Message
putDoubleProperty
in class CoreMessage
public ClientMessageImpl putStringProperty(SimpleString key, SimpleString value)
putStringProperty
in interface Message
putStringProperty
in class CoreMessage
public ClientMessageImpl putStringProperty(SimpleString key, String value)
putStringProperty
in interface Message
putStringProperty
in class CoreMessage
public ClientMessageImpl putObjectProperty(SimpleString key, Object value) throws ActiveMQPropertyConversionException
putObjectProperty
in interface Message
putObjectProperty
in class CoreMessage
ActiveMQPropertyConversionException
public ClientMessageImpl putObjectProperty(String key, Object value) throws ActiveMQPropertyConversionException
putObjectProperty
in interface Message
putObjectProperty
in class CoreMessage
ActiveMQPropertyConversionException
public ClientMessageImpl putBooleanProperty(String key, boolean value)
ClientMessage
Message
to enable fluent APIputBooleanProperty
in interface ClientMessage
putBooleanProperty
in interface Message
putBooleanProperty
in class CoreMessage
public ClientMessageImpl putByteProperty(String key, byte value)
ClientMessage
Message
to enable fluent APIputByteProperty
in interface ClientMessage
putByteProperty
in interface Message
putByteProperty
in class CoreMessage
public ClientMessageImpl putBytesProperty(String key, byte[] value)
ClientMessage
Message
to enable fluent APIputBytesProperty
in interface ClientMessage
putBytesProperty
in interface Message
putBytesProperty
in class CoreMessage
public ClientMessageImpl putShortProperty(String key, short value)
ClientMessage
Message
to enable fluent APIputShortProperty
in interface ClientMessage
putShortProperty
in interface Message
putShortProperty
in class CoreMessage
public ClientMessageImpl putIntProperty(String key, int value)
ClientMessage
Message
to enable fluent APIputIntProperty
in interface ClientMessage
putIntProperty
in interface Message
putIntProperty
in class CoreMessage
public ClientMessageImpl putLongProperty(String key, long value)
ClientMessage
Message
to enable fluent APIputLongProperty
in interface ClientMessage
putLongProperty
in interface Message
putLongProperty
in class CoreMessage
public ClientMessageImpl putFloatProperty(String key, float value)
ClientMessage
Message
to enable fluent APIputFloatProperty
in interface ClientMessage
putFloatProperty
in interface Message
putFloatProperty
in class CoreMessage
public ClientMessageImpl putDoubleProperty(String key, double value)
ClientMessage
Message
to enable fluent APIputDoubleProperty
in interface ClientMessage
putDoubleProperty
in interface Message
putDoubleProperty
in class CoreMessage
public ClientMessageImpl putStringProperty(String key, String value)
Message
putStringProperty
in interface ClientMessage
putStringProperty
in interface Message
putStringProperty
in class CoreMessage
key
- property namevalue
- property valuepublic ClientMessageImpl writeBodyBufferBytes(byte[] bytes)
ClientMessage
Message
to enable fluent APIwriteBodyBufferBytes
in interface ClientMessage
public ClientMessageImpl writeBodyBufferString(String string)
ClientMessage
Message
to enable fluent APIwriteBodyBufferString
in interface ClientMessage
Copyright © 2020 JBoss by Red Hat. All rights reserved.