Class Message

java.lang.Object
com.amazonaws.services.sqs.model.Message
All Implemented Interfaces:
Serializable, Cloneable

public class Message extends Object implements Serializable, Cloneable

An Amazon SQS message.

See Also:
  • Constructor Details

    • Message

      public Message()
  • Method Details

    • setMessageId

      public void setMessageId(String messageId)

      A unique identifier for the message. Message IDs are considered unique across all AWS accounts for an extended period of time.

      Parameters:
      messageId - A unique identifier for the message. Message IDs are considered unique across all AWS accounts for an extended period of time.
    • getMessageId

      public String getMessageId()

      A unique identifier for the message. Message IDs are considered unique across all AWS accounts for an extended period of time.

      Returns:
      A unique identifier for the message. Message IDs are considered unique across all AWS accounts for an extended period of time.
    • withMessageId

      public Message withMessageId(String messageId)

      A unique identifier for the message. Message IDs are considered unique across all AWS accounts for an extended period of time.

      Parameters:
      messageId - A unique identifier for the message. Message IDs are considered unique across all AWS accounts for an extended period of time.
      Returns:
      Returns a reference to this object so that method calls can be chained together.
    • setReceiptHandle

      public void setReceiptHandle(String receiptHandle)

      An identifier associated with the act of receiving the message. A new receipt handle is returned every time you receive a message. When deleting a message, you provide the last received receipt handle to delete the message.

      Parameters:
      receiptHandle - An identifier associated with the act of receiving the message. A new receipt handle is returned every time you receive a message. When deleting a message, you provide the last received receipt handle to delete the message.
    • getReceiptHandle

      public String getReceiptHandle()

      An identifier associated with the act of receiving the message. A new receipt handle is returned every time you receive a message. When deleting a message, you provide the last received receipt handle to delete the message.

      Returns:
      An identifier associated with the act of receiving the message. A new receipt handle is returned every time you receive a message. When deleting a message, you provide the last received receipt handle to delete the message.
    • withReceiptHandle

      public Message withReceiptHandle(String receiptHandle)

      An identifier associated with the act of receiving the message. A new receipt handle is returned every time you receive a message. When deleting a message, you provide the last received receipt handle to delete the message.

      Parameters:
      receiptHandle - An identifier associated with the act of receiving the message. A new receipt handle is returned every time you receive a message. When deleting a message, you provide the last received receipt handle to delete the message.
      Returns:
      Returns a reference to this object so that method calls can be chained together.
    • setMD5OfBody

      public void setMD5OfBody(String mD5OfBody)

      An MD5 digest of the non-URL-encoded message body string.

      Parameters:
      mD5OfBody - An MD5 digest of the non-URL-encoded message body string.
    • getMD5OfBody

      public String getMD5OfBody()

      An MD5 digest of the non-URL-encoded message body string.

      Returns:
      An MD5 digest of the non-URL-encoded message body string.
    • withMD5OfBody

      public Message withMD5OfBody(String mD5OfBody)

      An MD5 digest of the non-URL-encoded message body string.

      Parameters:
      mD5OfBody - An MD5 digest of the non-URL-encoded message body string.
      Returns:
      Returns a reference to this object so that method calls can be chained together.
    • setBody

      public void setBody(String body)

      The message's contents (not URL-encoded).

      Parameters:
      body - The message's contents (not URL-encoded).
    • getBody

      public String getBody()

      The message's contents (not URL-encoded).

      Returns:
      The message's contents (not URL-encoded).
    • withBody

      public Message withBody(String body)

      The message's contents (not URL-encoded).

      Parameters:
      body - The message's contents (not URL-encoded).
      Returns:
      Returns a reference to this object so that method calls can be chained together.
    • getAttributes

      public Map<String,String> getAttributes()

      SenderId, SentTimestamp, ApproximateReceiveCount, and/or ApproximateFirstReceiveTimestamp. SentTimestamp and ApproximateFirstReceiveTimestamp are each returned as an integer representing the epoch time in milliseconds.

      Returns:
      SenderId, SentTimestamp, ApproximateReceiveCount, and/or ApproximateFirstReceiveTimestamp. SentTimestamp and ApproximateFirstReceiveTimestamp are each returned as an integer representing the epoch time
    • setAttributes

      SenderId, SentTimestamp, ApproximateReceiveCount, and/or ApproximateFirstReceiveTimestamp. SentTimestamp and ApproximateFirstReceiveTimestamp are each returned as an integer representing the epoch time in milliseconds.

      Parameters:
      attributes - SenderId, SentTimestamp, ApproximateReceiveCount, and/or ApproximateFirstReceiveTimestamp. SentTimestamp and ApproximateFirstReceiveTimestamp are each returned as an integer representing the epoch time
    • withAttributes

      public Message withAttributes(Map<String,String> attributes)

      SenderId, SentTimestamp, ApproximateReceiveCount, and/or ApproximateFirstReceiveTimestamp. SentTimestamp and ApproximateFirstReceiveTimestamp are each returned as an integer representing the epoch time in milliseconds.

      Parameters:
      attributes - SenderId, SentTimestamp, ApproximateReceiveCount, and/or ApproximateFirstReceiveTimestamp. SentTimestamp and ApproximateFirstReceiveTimestamp are each returned as an integer representing the epoch time
      Returns:
      Returns a reference to this object so that method calls can be chained together.
    • addAttributesEntry

      public Message addAttributesEntry(String key, String value)
    • clearAttributesEntries

      public Message clearAttributesEntries()
      Removes all the entries added into Attributes. <p> Returns a reference to this object so that method calls can be chained together.
    • setMD5OfMessageAttributes

      public void setMD5OfMessageAttributes(String mD5OfMessageAttributes)

      An MD5 digest of the non-URL-encoded message attribute string. This can be used to verify that Amazon SQS received the message correctly. Amazon SQS first URL decodes the message before creating the MD5 digest. For information about MD5, go to http://www.faqs.org/rfcs/rfc1321.html.

      Parameters:
      mD5OfMessageAttributes - An MD5 digest of the non-URL-encoded message attribute string. This can be used to verify that Amazon SQS received the message correctly. Amazon SQS first URL decodes the message before creating the MD5 digest. For information about MD5, go to http://www.faqs.org/rfcs/rfc1321.html.
    • getMD5OfMessageAttributes

      public String getMD5OfMessageAttributes()

      An MD5 digest of the non-URL-encoded message attribute string. This can be used to verify that Amazon SQS received the message correctly. Amazon SQS first URL decodes the message before creating the MD5 digest. For information about MD5, go to http://www.faqs.org/rfcs/rfc1321.html.

      Returns:
      An MD5 digest of the non-URL-encoded message attribute string. This can be used to verify that Amazon SQS received the message correctly. Amazon SQS first URL decodes the message before creating the MD5 digest. For information about MD5, go to http://www.faqs.org/rfcs /rfc1321.html.
    • withMD5OfMessageAttributes

      public Message withMD5OfMessageAttributes(String mD5OfMessageAttributes)

      An MD5 digest of the non-URL-encoded message attribute string. This can be used to verify that Amazon SQS received the message correctly. Amazon SQS first URL decodes the message before creating the MD5 digest. For information about MD5, go to http://www.faqs.org/rfcs/rfc1321.html.

      Parameters:
      mD5OfMessageAttributes - An MD5 digest of the non-URL-encoded message attribute string. This can be used to verify that Amazon SQS received the message correctly. Amazon SQS first URL decodes the message before creating the MD5 digest. For information about MD5, go to http://www.faqs.org/rfcs/rfc1321.html.
      Returns:
      Returns a reference to this object so that method calls can be chained together.
    • getMessageAttributes

      public Map<String,MessageAttributeValue> getMessageAttributes()

      Each message attribute consists of a Name, Type, and Value. For more information, see Message Attribute Items.

      Returns:
      Each message attribute consists of a Name, Type, and Value. For more information, see Message Attribute Items.
    • setMessageAttributes

      public void setMessageAttributes(Map<String,MessageAttributeValue> messageAttributes)

      Each message attribute consists of a Name, Type, and Value. For more information, see Message Attribute Items.

      Parameters:
      messageAttributes - Each message attribute consists of a Name, Type, and Value. For more information, see Message Attribute Items.
    • withMessageAttributes

      public Message withMessageAttributes(Map<String,MessageAttributeValue> messageAttributes)

      Each message attribute consists of a Name, Type, and Value. For more information, see Message Attribute Items.

      Parameters:
      messageAttributes - Each message attribute consists of a Name, Type, and Value. For more information, see Message Attribute Items.
      Returns:
      Returns a reference to this object so that method calls can be chained together.
    • addMessageAttributesEntry

      public Message addMessageAttributesEntry(String key, MessageAttributeValue value)
    • clearMessageAttributesEntries

      public Message clearMessageAttributesEntries()
      Removes all the entries added into MessageAttributes. <p> Returns a reference to this object so that method calls can be chained together.
    • toString

      public String toString()
      Returns a string representation of this object; useful for testing and debugging.
      Overrides:
      toString in class Object
      Returns:
      A string representation of this object.
      See Also:
    • equals

      public boolean equals(Object obj)
      Overrides:
      equals in class Object
    • hashCode

      public int hashCode()
      Overrides:
      hashCode in class Object
    • clone

      public Message clone()
      Overrides:
      clone in class Object