Permalink
Browse files

Added getMessageById method

  • Loading branch information...
1 parent 05a4b53 commit 9882c2452985c1251d31a2f56c29171942bf229d @gabrielayuso gabrielayuso committed Oct 4, 2013
Showing with 13 additions and 0 deletions.
  1. +13 −0 IronMQ.class.php
View
@@ -330,6 +330,19 @@ public function getMessage($queue_name, $timeout = self::GET_MESSAGE_TIMEOUT) {
}
/**
+ * Get the message with the given id.
+ * @param string $queue_name Queue name
+ * @param string $message_id Message ID
+ * @return mixed
+ */
+ public function getMessageById($queue_name, $message_id) {
+ $this->setCommonHeaders();
+ $queue = rawurlencode($queue_name);
+ $url = "projects/{$this->project_id}/queues/$queue/messages/{$message_id}";
+ return self::json_decode($this->apiCall(self::GET, $url));
+ }
+
+ /**
* Delete a Message from a Queue
* This call will delete the message. Be sure you call this after you’re done with a message or it will be placed back on the queue.
*

0 comments on commit 9882c24

Please sign in to comment.