Skip to content

Message queue consumer never exiting when --max-messages specified. #17951

@deefco

Description

@deefco

Preconditions

  1. Magento version 2.3.x & 2.4-develop

Steps to reproduce

  1. Create new consumer, subscribe it to empty topic
  2. Start consumer using bin/magento queue:consumers:start ConsumerName --max-messages 1

Expected result

  1. Consumer tries to get 1 message from empty queue, exits.

Actual result

  1. Consumer keeps listening forever, never exits.

Additional information

This behaviour is caused by the following commit: https://github.com/magento-partners/magento2ee/commit/19721b54aae0f18632b58486a3af544d37e5a866#diff-9876e6dc23c7c514b028b967d58aa0b0

Which unfortunately isn't public because message queue was developed for EE. The class CallbackInvoker was changed so the path taken when --max-messages is supplied enters an endless loop instead of exiting.

Only information supplied is this: "MAGETWO-57177: [Critical][OMS] Max messages makes the consumer die after existing messages are consumed" even though this is expected behaviour according to the developer documentation.

Can anyone please explain the reason for this change? Opening issue here because message queue is being moved to community edition in 2.3.0

Metadata

Metadata

Assignees

No one assigned

    Labels

    Component: CronIssue: Clear DescriptionGate 2 Passed. Manual verification of the issue description passedIssue: ConfirmedGate 3 Passed. Manual verification of the issue completed. Issue is confirmedIssue: Format is validGate 1 Passed. Automatic verification of issue format passedIssue: Ready for WorkGate 4. Acknowledged. Issue is added to backlog and ready for developmentProgress: doneReproduced on 2.3.xThe issue has been reproduced on latest 2.3 releaseReproduced on 2.4.xThe issue has been reproduced on latest 2.4-develop branchTriage: Dev.ExperienceIssue related to Developer Experience and needs help with Triage to Confirm or Reject it

    Type

    No type

    Projects

    Status

    Done

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions