RabbitMQ claimItem()->data does not return objects submited to createItem()

Created on 11 October 2022, almost 2 years ago
Updated 28 July 2023, about 1 year ago

Problem/Motivation

If I do:

\Drupal::queue('my_queue')->createItem(['id' => 42]);

and then

\Drupal::queue('my_queue')->claimItem();

I don't get back the array I passed in, but an object with an 'id' property.

But the docs for claimItem() explicitly say the exact same $data should be provided:

   * @return
   *   On success we return an item object. If the queue is unable to claim an
   *   item it returns false. This implies a best effort to retrieve an item
   *   and either the queue is empty or there is some other non-recoverable
   *   problem.
   *
   *   If returned, the object will have at least the following properties:
   *   - data: the same as what passed into createItem().
   *   - item_id: the unique ID returned from createItem().
   *   - created: timestamp when the item was put into the queue.
   */

Steps to reproduce

Proposed resolution

Remaining tasks

User interface changes

API changes

Data model changes

πŸ› Bug report
Status

Fixed

Version

4.0

Component

Code

Created by

πŸ‡¬πŸ‡§United Kingdom joachim

Live updates comments and jobs are added and updated live.
  • Needs issue summary update

    Issue summaries save everyone time if they are kept up-to-date. See Update issue summary task instructions.

Sign in to follow issues

Comments & Activities

Not all content is available!

It's likely this issue predates Contrib.social: some issue and comment data are missing.

Production build 0.71.5 2024