Skip to content

[Messenger] Fix some syntax issue #20687

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Mar 4, 2025

Conversation

javiereguiluz
Copy link
Member

In addition to the syntax issue, there's another pending issue: which option does it refer to? I can't see the keepalive option in the list of options above it.

So, is the option missing ... or should we delete this versionadded directive?

@javiereguiluz javiereguiluz added this to the 7.2 milestone Feb 24, 2025
@carsonbot carsonbot changed the title [Messenger] Fix some syntax issue [Notifier] Fix some syntax issue Feb 24, 2025
@carsonbot carsonbot modified the milestones: 7.2, 7.3 Feb 24, 2025
@carsonbot carsonbot changed the title [Notifier] Fix some syntax issue [Messenger][Notifier] Fix some syntax issue Feb 24, 2025
@javiereguiluz javiereguiluz changed the base branch from 7.3 to 7.2 February 24, 2025 15:37
@carsonbot carsonbot changed the title [Messenger][Notifier] Fix some syntax issue [Messenger] Fix some syntax issue Feb 24, 2025
@mdoutreluingne
Copy link
Contributor

mdoutreluingne commented Feb 24, 2025

I think this is an oversight, because for Amazon SQS transport, the keepalive option still exists.

I've also noticed that the option keepalive is missing from the list of options for Beanstalkd Transport

@javiereguiluz javiereguiluz modified the milestones: 7.3, 7.2 Feb 25, 2025
@javiereguiluz
Copy link
Member Author

javiereguiluz commented Feb 25, 2025

Maxime, thanks for reviewing this. I've added some content based on the docs of these services. But, I have no experience in this, so please review it. Thanks!

@mdoutreluingne
Copy link
Contributor

I have little experience in this and I'm not familiar with this transports, especially as there can be differences depending on the type of transport.

In my opinion and according to my research, it looks good but I'm not sure.

Need review for the keepalive option for the Amazon SQS transport and Beanstalkd transport, can you review this please ?

cc @HypeMC @valtzu

@valtzu
Copy link

valtzu commented Feb 26, 2025

I don't think we added anything to the transport options – what was added was support for --keepalive in messenger:consume command, for these specific transports.

How SQS works with --keepalive:

bin/console messenger:consume --keepalive=10 async
framework:
  messenger:
    transports:
      async: 'sqs://...?visibility_timeout=15'

Every 10 seconds, for all the messages that are still being processed, the visibility of a message is re-set to visibility_timeout.

When using --keepalive, visibility_timeout must be bigger than --keepalive value.

This mechanism allows to keep visibility_timeout rather small, thus, in case the worker dies, the message is redelivered faster. Without --keepalive, a message that takes more than visibility_timeout to process would lead into double-processing as SQS would redeliver it while it's already being processed.

messenger.rst Outdated
@@ -1713,6 +1713,10 @@ The Beanstalkd transport DSN may looks like this:

The transport has a number of options:

``keepalive`` (default: none)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The default keepalive interval is actually 5 seconds. When the option is used without an explicit value, it activates the keepalive mechanism with that default value. You can optionally set a different interval by providing a value for the option.

@HypeMC
Copy link
Member

HypeMC commented Feb 27, 2025

I don't think we added anything to the transport options – what was added was support for --keepalive in messenger:consume command, for these specific transports.

Ok, I just noticed that this was added to the list of transport options. @valtzu is right, there were no options added to the transports themselves, only to the messenger:consume and messenger:failed:retry commands. These console command options tell the Worker to asynchronously use the transport's keepalive mechanism if it's implemented.

@javiereguiluz
Copy link
Member Author

Thanks a lot folks! I now understand this. I made some changes based on your comments.

@mdoutreluingne
Copy link
Contributor

Thanks a lot for explaining this, I understand better.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants