Skip to content

How to implement symfony messenger #513

Answered by MichaelBrauner
tdumalin asked this question in Q&A
Discussion options

You must be logged in to vote

Hi tdumalin,

You might consider using the --limit option with messenger:consume:

php-worker:
  build:
    context: .
    target: frankenphp_dev
  image: ${IMAGES_PREFIX:-}app-php
  restart: unless-stopped
  command: php bin/console messenger:consume async -v --limit=10000

With this setup, the restart: unless-stopped Docker directive ensures that the container is automatically restarted after processing the specified number of messages.

This approach avoids the need for external process control systems.
Please let me know what you think about it and how you solved this issue (which has been a while now).

Replies: 1 comment 2 replies

Comment options

You must be logged in to vote
2 replies
@tdumalin
Comment options

@leroy0211
Comment options

Answer selected by tdumalin
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
3 participants