Package org.apache.activemq.command
Class Message
java.lang.Object
org.apache.activemq.command.BaseCommand
org.apache.activemq.command.Message
- All Implemented Interfaces:
MessageReference,Command,DataStructure,MarshallAware
- Direct Known Subclasses:
ActiveMQMessage
Represents an ActiveMQ message
-
Nested Class Summary
Nested Classes -
Field Summary
FieldsModifier and TypeFieldDescriptionprotected longprotected longprotected longprotected booleanprotected ByteSequenceprotected Stringprotected DataStructurestatic final intThe default minimum amount of memory a message is assumed to useprotected longprotected ActiveMQDestinationprotected booleanprotected longprotected Stringprotected intprotected booleanprotected ByteSequenceprotected MessageIdstatic final Stringprotected ActiveMQDestinationprotected TransactionIdprotected booleanprotected byteprotected ProducerIdprotected booleanprotected booleanprotected booleanprotected intprotected ActiveMQDestinationprotected intprotected ConsumerIdprotected longprotected TransactionIdprotected Stringprotected StringFields inherited from class org.apache.activemq.command.BaseCommand
commandId, responseRequired -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidafterMarshall(WireFormat wireFormat) voidafterUnmarshall(WireFormat wireFormat) voidbeforeMarshall(WireFormat wireFormat) voidbeforeUnmarshall(WireFormat wireFormat) booleanabstract voidvoidvoidvoidcompress()abstract Messagecopy()protected voidintprotected voidlongUsed to schedule the arrival time of a message to a broker.longlongBrokerId[]The route of brokers the command has moved through.BrokerId[]If a message is stored in multiple nodes on a cluster, all the cluster members will be listed here.longintprotected intbytegetProperty(String name) intintintgetSize()Can be used to route the message to a specific consumer.longgetType()Only set by the broker and defines the userID of the producer connection who sent this message.voidintbooleanbooleanprotected booleanbooleanbooleanReturns true if this message is dropped.booleanReturns true if this message is expiredbooleanbooleanbooleanbooleanbooleanbooleanprotected booleanbooleanbooleanbooleanbooleanprotected voidvoidprotected ObjectInitialize the transient fields at deserialization to get a normal state.voidremoveProperty(String name) voidsetArrival(long arrival) voidsetBrokerInTime(long brokerInTime) voidsetBrokerOutTime(long brokerOutTime) voidsetBrokerPath(BrokerId[] brokerPath) voidsetCluster(BrokerId[] cluster) voidsetCompressed(boolean compressed) voidsetConnection(ActiveMQConnection connection) voidsetContent(ByteSequence content) voidsetCorrelationId(String correlationId) voidvoidsetDestination(ActiveMQDestination destination) voidsetDroppable(boolean droppable) voidsetExpiration(long expiration) voidsetGroupID(String groupID) voidsetGroupSequence(int groupSequence) voidsetJMSXGroupFirstForConsumer(boolean val) voidsetMarshalledProperties(ByteSequence marshalledProperties) voidsetMemoryUsage(MemoryUsage usage) voidsetMessageId(MessageId messageId) voidsetOriginalDestination(ActiveMQDestination destination) voidsetOriginalTransactionId(TransactionId transactionId) voidsetPersistent(boolean deliveryMode) voidsetPriority(byte priority) voidsetProducerId(ProducerId producerId) voidsetProperty(String name, Object value) voidsetReadOnlyBody(boolean readOnlyBody) voidsetReadOnlyProperties(boolean readOnlyProperties) voidsetRecievedByDFBridge(boolean recievedByDFBridge) voidsetRedelivered(boolean redelivered) voidsetRedeliveryCounter(int deliveryCounter) voidsetRegionDestination(Message.MessageDestination destination) voidsetReplyTo(ActiveMQDestination replyTo) voidsetTargetConsumerId(ConsumerId targetConsumerId) voidsetTimestamp(long timestamp) voidsetTransactionId(TransactionId transactionId) voidvoidabstract voidabstract voidtoString()Methods inherited from class org.apache.activemq.command.BaseCommand
copy, getCommandId, getFrom, getTo, isBrokerInfo, isConnectionControl, isConsumerControl, isMessageAck, isMessageDispatch, isMessageDispatchNotification, isResponse, isResponseRequired, isShutdownInfo, isWireFormatInfo, setCommandId, setFrom, setResponseRequired, setToMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitMethods inherited from interface org.apache.activemq.command.DataStructure
getDataStructureType
-
Field Details
-
ORIGINAL_EXPIRATION
- See Also:
-
DEFAULT_MINIMUM_MESSAGE_SIZE
public static final int DEFAULT_MINIMUM_MESSAGE_SIZEThe default minimum amount of memory a message is assumed to use- See Also:
-
messageId
-
originalDestination
-
originalTransactionId
-
producerId
-
destination
-
transactionId
-
deliveryTime
protected long deliveryTime -
expiration
protected long expiration -
timestamp
protected long timestamp -
arrival
protected long arrival -
brokerInTime
protected long brokerInTime -
brokerOutTime
protected long brokerOutTime -
correlationId
-
replyTo
-
persistent
protected boolean persistent -
type
-
priority
protected byte priority -
groupID
-
groupSequence
protected int groupSequence -
targetConsumerId
-
compressed
protected boolean compressed -
userID
-
-
marshalledProperties
-
dataStructure
-
redeliveryCounter
protected int redeliveryCounter -
size
protected int size -
properties
-
readOnlyProperties
protected boolean readOnlyProperties -
readOnlyBody
protected boolean readOnlyBody -
recievedByDFBridge
protected transient boolean recievedByDFBridge -
droppable
protected boolean droppable -
jmsXGroupFirstForConsumer
protected boolean jmsXGroupFirstForConsumer
-
-
Constructor Details
-
Message
public Message()
-
-
Method Details
-
copy
-
clearBody
public abstract void clearBody() throws jakarta.jms.JMSException- Throws:
jakarta.jms.JMSException
-
storeContent
public abstract void storeContent() -
storeContentAndClear
public abstract void storeContentAndClear() -
clearUnMarshalledState
public void clearUnMarshalledState() throws jakarta.jms.JMSException- Throws:
jakarta.jms.JMSException
-
isMarshalled
public boolean isMarshalled() -
isPropertiesMarshalled
protected boolean isPropertiesMarshalled() -
isContentMarshalled
protected boolean isContentMarshalled() -
copy
-
getProperty
- Throws:
IOException
-
getProperties
- Throws:
IOException
-
clearProperties
public void clearProperties() -
setProperty
- Throws:
IOException
-
removeProperty
- Throws:
IOException
-
lazyCreateProperties
- Throws:
IOException
-
beforeMarshall
- Specified by:
beforeMarshallin interfaceMarshallAware- Throws:
IOException
-
afterMarshall
- Specified by:
afterMarshallin interfaceMarshallAware- Throws:
IOException
-
beforeUnmarshall
- Specified by:
beforeUnmarshallin interfaceMarshallAware- Throws:
IOException
-
afterUnmarshall
- Specified by:
afterUnmarshallin interfaceMarshallAware- Throws:
IOException
-
getProducerId
-
setProducerId
-
getDestination
-
setDestination
-
getTransactionId
-
setTransactionId
-
isInTransaction
public boolean isInTransaction() -
getOriginalDestination
-
setOriginalDestination
-
getMessageId
- Specified by:
getMessageIdin interfaceMessageReference
-
setMessageId
-
getOriginalTransactionId
-
setOriginalTransactionId
-
getGroupID
- Specified by:
getGroupIDin interfaceMessageReference
-
setGroupID
-
getGroupSequence
public int getGroupSequence()- Specified by:
getGroupSequencein interfaceMessageReference
-
setGroupSequence
public void setGroupSequence(int groupSequence) -
getCorrelationId
-
setCorrelationId
-
isPersistent
public boolean isPersistent()- Specified by:
isPersistentin interfaceMessageReference
-
setPersistent
public void setPersistent(boolean deliveryMode) -
getExpiration
public long getExpiration()- Specified by:
getExpirationin interfaceMessageReference
-
setExpiration
public void setExpiration(long expiration) -
getPriority
public byte getPriority() -
setPriority
public void setPriority(byte priority) -
getReplyTo
-
setReplyTo
-
getTimestamp
public long getTimestamp() -
setTimestamp
public void setTimestamp(long timestamp) -
getType
-
setType
-
getContent
-
setContent
-
getMarshalledProperties
-
setMarshalledProperties
-
getDataStructure
-
setDataStructure
-
getTargetConsumerId
Can be used to route the message to a specific consumer. Should be null to allow the broker use normal JMS routing semantics. If the target consumer id is an active consumer on the broker, the message is dropped. Used by the AdvisoryBroker to replay advisory messages to a specific consumer.- Specified by:
getTargetConsumerIdin interfaceMessageReference
-
setTargetConsumerId
-
isExpired
public boolean isExpired()Description copied from interface:MessageReferenceReturns true if this message is expired- Specified by:
isExpiredin interfaceMessageReference
-
isAdvisory
public boolean isAdvisory()- Specified by:
isAdvisoryin interfaceMessageReference- Returns:
- true if the message is an advisory
-
isCompressed
public boolean isCompressed() -
setCompressed
public void setCompressed(boolean compressed) -
isRedelivered
public boolean isRedelivered() -
setRedelivered
public void setRedelivered(boolean redelivered) -
incrementRedeliveryCounter
public void incrementRedeliveryCounter()- Specified by:
incrementRedeliveryCounterin interfaceMessageReference
-
getRedeliveryCounter
public int getRedeliveryCounter()- Specified by:
getRedeliveryCounterin interfaceMessageReference
-
setRedeliveryCounter
public void setRedeliveryCounter(int deliveryCounter) -
getBrokerPath
The route of brokers the command has moved through. -
setBrokerPath
-
isReadOnlyProperties
public boolean isReadOnlyProperties() -
setReadOnlyProperties
public void setReadOnlyProperties(boolean readOnlyProperties) -
isReadOnlyBody
public boolean isReadOnlyBody() -
setReadOnlyBody
public void setReadOnlyBody(boolean readOnlyBody) -
getConnection
-
setConnection
-
getArrival
public long getArrival()Used to schedule the arrival time of a message to a broker. The broker will not dispatch a message to a consumer until it's arrival time has elapsed. -
setArrival
public void setArrival(long arrival) -
getUserID
Only set by the broker and defines the userID of the producer connection who sent this message. This is an optional field, it needs to be enabled on the broker to have this field populated. -
setUserID
-
getReferenceCount
public int getReferenceCount()- Specified by:
getReferenceCountin interfaceMessageReference
-
getMessageHardRef
- Specified by:
getMessageHardRefin interfaceMessageReference
-
getMessage
- Specified by:
getMessagein interfaceMessageReference
-
setRegionDestination
-
getRegionDestination
- Specified by:
getRegionDestinationin interfaceMessageReference
-
getMemoryUsage
-
setMemoryUsage
-
isMarshallAware
public boolean isMarshallAware()- Specified by:
isMarshallAwarein interfaceDataStructure- Overrides:
isMarshallAwarein classBaseCommand
-
incrementReferenceCount
public int incrementReferenceCount()- Specified by:
incrementReferenceCountin interfaceMessageReference
-
decrementReferenceCount
public int decrementReferenceCount()- Specified by:
decrementReferenceCountin interfaceMessageReference
-
getSize
public int getSize()- Specified by:
getSizein interfaceMessageReference
-
getMinimumMessageSize
protected int getMinimumMessageSize() -
isRecievedByDFBridge
public boolean isRecievedByDFBridge()- Returns:
- Returns the recievedByDFBridge.
-
setRecievedByDFBridge
public void setRecievedByDFBridge(boolean recievedByDFBridge) - Parameters:
recievedByDFBridge- The recievedByDFBridge to set.
-
onMessageRolledBack
public void onMessageRolledBack() -
isDroppable
public boolean isDroppable() -
setDroppable
public void setDroppable(boolean droppable) -
getCluster
If a message is stored in multiple nodes on a cluster, all the cluster members will be listed here. Otherwise, it will be null. -
setCluster
-
isMessage
public boolean isMessage()- Specified by:
isMessagein interfaceCommand- Overrides:
isMessagein classBaseCommand
-
getBrokerInTime
public long getBrokerInTime() -
setBrokerInTime
public void setBrokerInTime(long brokerInTime) -
getBrokerOutTime
public long getBrokerOutTime() -
setBrokerOutTime
public void setBrokerOutTime(long brokerOutTime) -
isDropped
public boolean isDropped()Description copied from interface:MessageReferenceReturns true if this message is dropped.- Specified by:
isDroppedin interfaceMessageReference
-
isJMSXGroupFirstForConsumer
public boolean isJMSXGroupFirstForConsumer() -
setJMSXGroupFirstForConsumer
public void setJMSXGroupFirstForConsumer(boolean val) -
compress
- Throws:
IOException
-
doCompress
- Throws:
IOException
-
toString
- Overrides:
toStringin classBaseCommand
-
toString
- Overrides:
toStringin classBaseCommand
-
canProcessAsExpired
public boolean canProcessAsExpired()- Specified by:
canProcessAsExpiredin interfaceMessageReference
-
readResolve
Initialize the transient fields at deserialization to get a normal state.- Throws:
ObjectStreamException- See Also:
-