Skip to content

Update mercure.rst: Moving Mercure's prod hub further upwards #20370

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
Nov 7, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
35 changes: 17 additions & 18 deletions mercure.rst
Original file line number Diff line number Diff line change
Expand Up @@ -48,13 +48,28 @@ Run this command to install the Mercure support:

$ composer require mercure

Running a Mercure Hub
~~~~~~~~~~~~~~~~~~~~~

To manage persistent connections, Mercure relies on a Hub: a dedicated server
that handles persistent SSE connections with the clients.
The Symfony app publishes the updates to the hub, that will broadcast them to
clients.

.. raw:: html

<object data="_images/mercure/hub.svg" type="image/svg+xml"
alt="Flow diagram showing a Symfony app communicating with the Mercure Hub using a POST request, and the Mercure Hub using SSE to communicate to the clients."
></object>

In production, you have to install a Mercure hub by yourself.
An official and open source (AGPL) hub based on the Caddy web server
can be downloaded as a static binary from `Mercure.rocks`_.
A Docker image, a Helm chart for Kubernetes
and a managed, High Availability Hub are also provided.

Thanks to :doc:`the Docker integration of Symfony </setup/docker>`,
:ref:`Flex <symfony-flex>` proposes to install a Mercure hub.
:ref:`Flex <symfony-flex>` proposes to install a Mercure hub for development.
Run ``docker-compose up`` to start the hub if you have chosen this option.

If you use the :doc:`Symfony Local Web Server </setup/symfony_server>`,
Expand All @@ -64,23 +79,7 @@ you must start it with the ``--no-tls`` option.

$ symfony server:start --no-tls -d

Running a Mercure Hub
~~~~~~~~~~~~~~~~~~~~~

.. raw:: html

<object data="_images/mercure/hub.svg" type="image/svg+xml"
alt="Flow diagram showing a Symfony app communicating with the Mercure Hub using a POST request, and the Mercure Hub using SSE to communicate to the clients."
></object>

If you use the Docker integration, a hub is already up and running,
and you can go straight to the next section.

Otherwise, and in production, you have to install a hub by yourself.
An official and open source (AGPL) Hub based on the Caddy web server
can be downloaded as a static binary from `Mercure.rocks`_.
A Docker image, a Helm chart for Kubernetes
and a managed, High Availability Hub are also provided.
If you use the Docker integration, a hub is already up and running.

Configuration
-------------
Expand Down
Loading