Hey! I am trying to use the queue client in an Yve...
# docker
h
Hey! I am trying to use the queue client in an Yves controller, but noticed that it doesn’t work since the broker env-variables are not passed to the Yves container. Adding the broker include block from zed.env.twig to yves.env.twig fixes it, but I am wondering if that is a proper fix. Is there a proper way to get the queue client to work?
h
Hello Andreas, What is the reason you want use broker from Yves?
h
Hey Mike, I am trying to create a file on the filesystem when a certain form is submitted in Yves. Since the form does not need to be created instantly, I wanted to solve this through a queue for better performance.
h
On which filesystem?
h
Zed, in the project’s /data directory
h
Ok. Thanks for clarification. Please, consider my notes: 1. Yves is stateless Frontend server. Any persistent data flow must go via Zed gateway. 2. Yves containers should have limited access to the services and should be in isolated network conditions. Only Zed gateway, denormalized data access, session and caches should be accessible. 3. Filesystem of the container cannot be assumed as a persistent storage. You would have multiple zed servers for high availability and scaling purposes. 4. A message in a broker queue should not be overloaded with the huge payload. Most message brokers have strict limitations on that. 5. The cost of putting file into the queue would be the same as putting into a file storage service or even better. So my suggestions are: 1. I would propose to not use containers filesystem as a persistent storage. Even more: I would recommend to avoid any RO/RW operations within PHP containers. 2. If you do not want to use Zed gateway for the uploading you would consider using another service that can manage file storing. 3. You can use https://www.php.net/manual/en/function.fastcgi-finish-request.php to release client and upload file in background. I would propose something more particular if you would give me more context, production environment specification and other info.
h
Alright thanks 🙂 Was just confused by the presence of the QueueClient since it made me think that the Queue should be able to be accessed by Yves.