public class SQSObjectMessage extends SQSMessage
It inherits from the Message interface and adds a body containing a single reference to an object. Only Serializable Java objects can be used.
When a client receives an ObjectMessage, it is in read-only mode. If a client attempts to write to the message at this point, a MessageNotWriteableException is thrown. If clearBody is called, the message can now be both read from and written to.
SQSMessage.JMSMessagePropertyValue, SQSMessage.TypeConversionSupportBYTE_MESSAGE_TYPE, JMS_SQS_MESSAGE_TYPE, JMS_SQS_REPLY_TO_QUEUE_NAME, JMS_SQS_REPLY_TO_QUEUE_URL, OBJECT_MESSAGE_TYPE, TEXT_MESSAGE_TYPE| Constructor and Description |
|---|
SQSObjectMessage()
Create new empty ObjectMessage to send.
|
SQSObjectMessage(Acknowledger acknowledger,
java.lang.String queueUrl,
Message sqsMessage)
Convert received SQSMessage into ObjectMessage
|
SQSObjectMessage(java.io.Serializable payload)
Create new ObjectMessage with payload to send.
|
| Modifier and Type | Method and Description |
|---|---|
void |
clearBody()
Sets the message body to write mode, and sets the object body to null
|
protected static java.io.Serializable |
deserialize(java.lang.String serialized)
Deserialize the
String into Serializable
object. |
java.lang.String |
getMessageBody() |
java.io.Serializable |
getObject()
Gets the
Serializable containing this message's body |
protected static java.lang.String |
serialize(java.io.Serializable serializable)
Serialize the
Serializable object to String. |
void |
setObject(java.io.Serializable payload)
Sets the
Serializable containing this message's body |
acknowledge, checkBodyWritePermissions, checkPropertyWritePermissions, clearProperties, convertExceptionToJMSException, convertExceptionToMessageFormatException, getBooleanProperty, getByteProperty, getDoubleProperty, getFloatProperty, getIntProperty, getJMSCorrelationID, getJMSCorrelationIDAsBytes, getJMSDeliveryMode, getJMSDestination, getJMSExpiration, getJMSMessageID, getJMSMessagePropertyValue, getJMSPriority, getJMSRedelivered, getJMSReplyTo, getJMSTimestamp, getJMSType, getLongProperty, getObjectProperty, getPropertyNames, getQueueUrl, getReceiptHandle, getShortProperty, getSQSMessageDeduplicationId, getSQSMessageGroupId, getSQSMessageId, getSQSMessageSequenceNumber, getStringProperty, propertyExists, setBodyWritePermissions, setBooleanProperty, setByteProperty, setDoubleProperty, setFloatProperty, setIntProperty, setJMSCorrelationID, setJMSCorrelationIDAsBytes, setJMSDeliveryMode, setJMSDestination, setJMSExpiration, setJMSMessageID, setJMSPriority, setJMSRedelivered, setJMSReplyTo, setJMSTimestamp, setJMSType, setLongProperty, setObjectProperty, setSequenceNumber, setShortProperty, setSQSMessageId, setStringPropertypublic SQSObjectMessage(Acknowledger acknowledger, java.lang.String queueUrl, Message sqsMessage) throws JMSException
JMSExceptionpublic SQSObjectMessage()
throws JMSException
JMSExceptionpublic SQSObjectMessage(java.io.Serializable payload)
throws JMSException
JMSExceptionpublic void setObject(java.io.Serializable payload)
throws JMSException
Serializable containing this message's bodypayload - The Serializable containing the message's bodyMessageNotWriteableException - If the message is in read-only mode.MessageFormatException - If object serialization fails.JMSExceptionpublic java.io.Serializable getObject()
throws JMSException
Serializable containing this message's bodyMessageFormatException - If object deserialization fails.JMSExceptionpublic void clearBody()
throws JMSException
clearBody in class SQSMessageJMSException - If directly calledprotected static java.io.Serializable deserialize(java.lang.String serialized)
throws JMSException
String into Serializable
object.JMSExceptionprotected static java.lang.String serialize(java.io.Serializable serializable)
throws JMSException
Serializable object to String.JMSExceptionpublic java.lang.String getMessageBody()