Determine Next Item in DrupalQueue for Drupal 7 I am trying to figure out how Drupal pulls what will be the next item to be processed in the queue for Drupal 7.  I have looked at SystemQueue::claimItem and I am missing something.  I have a queue that jams from time to time and I do not know how to figure out what record it is jamming on. 

Thanks,
Steve
SystemQueue::claimItem has the code you're looking for. https://api.drupal.org/api/drupal/modules%21system%21system.queue.inc/function/SystemQueue%3A%3AclaimItem/7.x

You can run the same query that will be used to get the next item in the queue. Just replace $this-&gt;name in the code below with the queue name.

    $item = db_query_range('SELECT data, item_id FROM {queue} q WHERE expire = 0 AND name = :name ORDER BY created, item_id ASC', 0, 1, array(
      ':name' =&gt; $this-&gt;name,
    ))
      -&gt;fetchObject();


$item should have everything you're looking for.