| Index: third_party/boto/boto/sqs/queue.py
|
| ===================================================================
|
| --- third_party/boto/boto/sqs/queue.py (revision 33376)
|
| +++ third_party/boto/boto/sqs/queue.py (working copy)
|
| @@ -182,7 +182,8 @@
|
| """
|
| return self.connection.remove_permission(self, label)
|
|
|
| - def read(self, visibility_timeout=None, wait_time_seconds=None):
|
| + def read(self, visibility_timeout=None, wait_time_seconds=None,
|
| + message_attributes=None):
|
| """
|
| Read a single message from the queue.
|
|
|
| @@ -195,11 +196,17 @@
|
| If a message is available, the call will return sooner than
|
| wait_time_seconds.
|
|
|
| + :type message_attributes: list
|
| + :param message_attributes: The name(s) of additional message
|
| + attributes to return. The default is to return no additional
|
| + message attributes. Use ``['All']`` or ``['.*']`` to return all.
|
| +
|
| :rtype: :class:`boto.sqs.message.Message`
|
| :return: A single message or None if queue is empty
|
| """
|
| rs = self.get_messages(1, visibility_timeout,
|
| - wait_time_seconds=wait_time_seconds)
|
| + wait_time_seconds=wait_time_seconds,
|
| + message_attributes=message_attributes)
|
| if len(rs) == 1:
|
| return rs[0]
|
| else:
|
| @@ -216,8 +223,8 @@
|
| :return: The :class:`boto.sqs.message.Message` object that was written.
|
| """
|
| new_msg = self.connection.send_message(self,
|
| - message.get_body_encoded(),
|
| - delay_seconds)
|
| + message.get_body_encoded(), delay_seconds=delay_seconds,
|
| + message_attributes=message.message_attributes)
|
| message.id = new_msg.id
|
| message.md5 = new_msg.md5
|
| return message
|
| @@ -231,10 +238,12 @@
|
| tuple represents a single message to be written
|
| and consists of and ID (string) that must be unique
|
| within the list of messages, the message body itself
|
| - which can be a maximum of 64K in length, and an
|
| + which can be a maximum of 64K in length, an
|
| integer which represents the delay time (in seconds)
|
| for the message (0-900) before the message will
|
| - be delivered to the queue.
|
| + be delivered to the queue, and an optional dict of
|
| + message attributes like those passed to ``send_message``
|
| + in the connection class.
|
| """
|
| return self.connection.send_message_batch(self, messages)
|
|
|
| @@ -254,7 +263,8 @@
|
|
|
| # get a variable number of messages, returns a list of messages
|
| def get_messages(self, num_messages=1, visibility_timeout=None,
|
| - attributes=None, wait_time_seconds=None):
|
| + attributes=None, wait_time_seconds=None,
|
| + message_attributes=None):
|
| """
|
| Get a variable number of messages.
|
|
|
| @@ -278,13 +288,19 @@
|
| If a message is available, the call will return sooner than
|
| wait_time_seconds.
|
|
|
| + :type message_attributes: list
|
| + :param message_attributes: The name(s) of additional message
|
| + attributes to return. The default is to return no additional
|
| + message attributes. Use ``['All']`` or ``['.*']`` to return all.
|
| +
|
| :rtype: list
|
| :return: A list of :class:`boto.sqs.message.Message` objects.
|
| """
|
| return self.connection.receive_message(
|
| self, number_messages=num_messages,
|
| visibility_timeout=visibility_timeout, attributes=attributes,
|
| - wait_time_seconds=wait_time_seconds)
|
| + wait_time_seconds=wait_time_seconds,
|
| + message_attributes=message_attributes)
|
|
|
| def delete_message(self, message):
|
| """
|
|
|