-
-
Notifications
You must be signed in to change notification settings - Fork 9.6k
[Messenger] Standardized Options for Transport Processing #28324
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
Comments
Isn't it the same than #27215? |
No, that's about adding the ability to retry (which is awesome), this would be standardizing transport config options that transports can respect (or not). |
But what would happen if you post a message asking for a 5s delay and your transport does not support delaying ? for the |
I mentioned in the original description, the idea would be that it would be optional for transports to implement. So, delaying is a somewhat common feature among queuing systems, SQS, Redis, DB, Rabbit MQ (with a plugin i believe) queues can all support it. I was hoping that each transport wouldn't have to define their own way of defining a delay. So if you use SQS you need to use the SQS envelope item Configuration and options for using delay, but if you use a Redis transport, you'll need to whatever envelope item configuration they would provide and so on and so forth. Does that make sense? As far as queue, that's just a name that we could change, but I don't think it's specific to just amqp, but would apply to a redis transport, sqs transport, and then even a db transport. |
but that's something that the transport abstraction already covers. So creating a second concept in the component makes it more complex for no real benefit.
We still need to specify what is expected to happen when you request a delay and the transport does not support it. If transports are free to either reject the message (saying they don't support it) or to dispatch it immediately, the abstration gets broken. |
@stof and this is what makes symfony great :), you guys think about this stuff. So, in the case of delay, one way to maybe support it is i think we'd need to add an empty interface for a transport to implement which can specify if it allows delays. And then a configuration option in the messenger system which allows us to configure the behavior to either throw if there is an unsupported transport option, or to silently let that through, and we default to the throw on exception. And we could possibly use that system for any other standardized options we'd allow on the transport. For queue, i don't full agree/disagree. Transports and queues are separate things. We do have the ability to route to transports and could potentially make different instances of transports with a specific queue set which could work. If we are good with this type of implementation, I think it would be helpful if we added documentation on Creating your own transport on how to specify a queue when defining transport configuration (or something to that affect). |
Note that in the case of AMQP, you don't even actually publish to a queue. You publish to an exchange (and then which queues this messages ends up in depends of how your broker is configured). So adding this concept of queues in Messenger might even make it more confusing. |
understood, I don't have too much experience with AMQP, but ya, it seems like just routing messages to different transport instances which are configured properly would be the best option for that. |
Agree with @stof. Let's close this one as there are no such "standardized options for transport processing". Even though things like retry would be great but there is already another issue for this. |
Description
Features like delaying a job before dispatching are things that would need to be handled per transport. I think it would be helpful to standardize the configuration around certain aspects of configuring transports/messages in the messenger component so that any transport can then optionally implement those options.
A few configuration options that could be worthwhile to put per message would be:
Now, each of those configuration items are handled in different parts of the system:
The idea is that we could standardize the way we set these configuration options on the messages and then different transports could make sure to implement them instead of forcing each transport to define their style of configuration.
Example
Where TransportConfiguration looks something like:
The text was updated successfully, but these errors were encountered: