public class SQSTextMessage extends SQSMessage
When a client receives a TextMessage, 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, OBJECT_MESSAGE_TYPE, TEXT_MESSAGE_TYPE| Constructor and Description |
|---|
SQSTextMessage()
Create new empty TextMessage to send.
|
SQSTextMessage(Acknowledger acknowledger,
java.lang.String queueUrl,
Message sqsMessage)
Convert received SQSMessage into TextMessage.
|
SQSTextMessage(java.lang.String payload)
Create new TextMessage with payload to send.
|
| Modifier and Type | Method and Description |
|---|---|
void |
clearBody()
Sets the message body to write mode, and sets the text to null
|
java.lang.String |
getText()
Gets the text containing this message's body.
|
void |
setText(java.lang.String string)
Sets the text 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, getSQSMessageId, getStringProperty, propertyExists, setBodyWritePermissions, setBooleanProperty, setByteProperty, setDoubleProperty, setFloatProperty, setIntProperty, setJMSCorrelationID, setJMSCorrelationIDAsBytes, setJMSDeliveryMode, setJMSDestination, setJMSExpiration, setJMSMessageID, setJMSPriority, setJMSRedelivered, setJMSReplyTo, setJMSTimestamp, setJMSType, setLongProperty, setObjectProperty, setShortProperty, setSQSMessageId, setStringPropertypublic SQSTextMessage(Acknowledger acknowledger, java.lang.String queueUrl, Message sqsMessage) throws JMSException
JMSExceptionpublic SQSTextMessage()
throws JMSException
JMSExceptionpublic SQSTextMessage(java.lang.String payload)
throws JMSException
JMSExceptionpublic void setText(java.lang.String string)
throws JMSException
string - The String containing the message's bodyMessageNotWriteableException - If the message is in read-only mode.JMSExceptionpublic java.lang.String getText()
throws JMSException
String containing the message's bodyJMSExceptionpublic void clearBody()
throws JMSException
clearBody in class SQSMessageJMSException - If directly called