What are the Slack Archives?

It’s a history of our time together in the Slack Community! There’s a ton of knowledge in here, so feel free to search through the archives for a possible answer to your question.

Because this space is not active, you won’t be able to create a new post or comment here. If you have a question or want to start a discussion about something, head over to our categories and pick one to post in! You can always refer back to a post from Slack Archives if needed; just copy the link to use it as a reference..

Hey! I am trying to use the queue client in an Yves controller, but noticed that it doesn’t work sin

UME3Z31P0
UME3Z31P0 Posts: 15 🧑🏻‍🚀 - Cadet

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?

Comments

  • sprymiker
    sprymiker Cloud Platform Architect Sprykee Posts: 781 🧑🏻‍🚀 - Cadet

    Hello Andreas,

    What is the reason you want use broker from Yves?

  • UME3Z31P0
    UME3Z31P0 Posts: 15 🧑🏻‍🚀 - Cadet

    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.

  • sprymiker
    sprymiker Cloud Platform Architect Sprykee Posts: 781 🧑🏻‍🚀 - Cadet

    On which filesystem?

  • UME3Z31P0
    UME3Z31P0 Posts: 15 🧑🏻‍🚀 - Cadet

    Zed, in the project’s /data directory

  • sprymiker
    sprymiker Cloud Platform Architect Sprykee Posts: 781 🧑🏻‍🚀 - Cadet

    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:
    6. 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.
    7. If you do not want to use Zed gateway for the uploading you would consider using another service that can manage file storing.
    8. 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.
  • UME3Z31P0
    UME3Z31P0 Posts: 15 🧑🏻‍🚀 - Cadet

    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.