public class SQSObjectMessage extends SQSMessage implements javax.jms.ObjectMessage
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_CORRELATION_ID, 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,
String queueUrl,
com.amazonaws.services.sqs.model.Message sqsMessage)
Convert received SQSMessage into ObjectMessage
|
SQSObjectMessage(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 Serializable |
deserialize(String serialized)
Deserialize the
String into Serializable
object. |
String |
getMessageBody() |
Serializable |
getObject()
Gets the
Serializable containing this message's body |
protected static String |
serialize(Serializable serializable)
Serialize the
Serializable object to String. |
void |
setObject(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, setStringPropertyclone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitacknowledge, clearProperties, getBooleanProperty, getByteProperty, getDoubleProperty, getFloatProperty, getIntProperty, getJMSCorrelationID, getJMSCorrelationIDAsBytes, getJMSDeliveryMode, getJMSDestination, getJMSExpiration, getJMSMessageID, getJMSPriority, getJMSRedelivered, getJMSReplyTo, getJMSTimestamp, getJMSType, getLongProperty, getObjectProperty, getPropertyNames, getShortProperty, getStringProperty, propertyExists, setBooleanProperty, setByteProperty, setDoubleProperty, setFloatProperty, setIntProperty, setJMSCorrelationID, setJMSCorrelationIDAsBytes, setJMSDeliveryMode, setJMSDestination, setJMSExpiration, setJMSMessageID, setJMSPriority, setJMSRedelivered, setJMSReplyTo, setJMSTimestamp, setJMSType, setLongProperty, setObjectProperty, setShortProperty, setStringPropertypublic SQSObjectMessage(Acknowledger acknowledger, String queueUrl, com.amazonaws.services.sqs.model.Message sqsMessage) throws javax.jms.JMSException
javax.jms.JMSExceptionpublic SQSObjectMessage()
throws javax.jms.JMSException
javax.jms.JMSExceptionpublic SQSObjectMessage(Serializable payload) throws javax.jms.JMSException
javax.jms.JMSExceptionpublic void setObject(Serializable payload) throws javax.jms.JMSException
Serializable containing this message's bodysetObject in interface javax.jms.ObjectMessagepayload - The Serializable containing the message's bodyMessageNotWriteableException - If the message is in read-only mode.MessageFormatException - If object serialization fails.javax.jms.JMSExceptionpublic Serializable getObject() throws javax.jms.JMSException
Serializable containing this message's bodygetObject in interface javax.jms.ObjectMessageMessageFormatException - If object deserialization fails.javax.jms.JMSExceptionpublic void clearBody()
throws javax.jms.JMSException
clearBody in interface javax.jms.MessageclearBody in class SQSMessagejavax.jms.JMSException - If directly calledprotected static Serializable deserialize(String serialized) throws javax.jms.JMSException
String into Serializable
object.javax.jms.JMSExceptionprotected static String serialize(Serializable serializable) throws javax.jms.JMSException
Serializable object to String.javax.jms.JMSExceptionpublic String getMessageBody()
Copyright © 2022. All rights reserved.