Skip to content

Kévin Dunglas

Founder of Les-Tilleuls.coop (worker-owned cooperative). Creator of API Platform, Mercure.rocks, Vulcain.rocks and of some Symfony components.

Menu
  • Talks
  • Resume
  • Sponsor me
  • Contact
Menu

Symfony and API Platform get “push” and real-time capabilities (Mercure protocol)

Posted on March 1, 2019March 2, 2019 by Kévin Dunglas
Official "push" and real-time capabilities for Symfony and API Platform (Mercure protocol) from Les-Tilleuls.coop

Mercure.rocks is a brand new protocol allowing to push data updates to web browsers and other HTTP clients in a convenient, fast, reliable and battery-efficient way. It is especially useful to publish real-time updates of resources served through web APIs, to reactive web and mobile apps.

Both Symfony and API Platform now have an official support for this protocol!

From the ground, Mercure has been designed to work with technologies not able to maintain persistent connections. It’s especially relevant in serverless environments, but is also convenient when using PHP or FastCGI scripts.

Mercure is basically a higher-level replacement for WebSocket. Unlike WebSocket, it is compatible with HTTP/2 and HTTP/3.
It has been designed with hypermedia APIs in mind, is auto-discoverable through the Web Linking RFC and is also compatible with GraphQL.
It natively supports authorization, reconnection in case of network issue (with refetching of missed events), subscribing to several topics, topics patterns (using templated URIs)…

Because it is built on top of Server-sent Events and plain old HTTP requests, it is already compatible with all modern browsers, and requires 0 client-side dependencies.

The protocol is open (available as an Internet Draft), and a reference open source implementation of the server written in Go is available.—

Related posts:

  1. HTTP/2: speed up your apps and dispatch real time updates (Symfony and API Platform’s features announcement)
  2. Mercure – Real-Time for PHP Made Easy (Forum PHP)
  3. Mercure: Real-Time APIs for Serverless and Beyond
  4. Symfony on steroids
: Vue.js, Mercure, Panther (SymfonyLive Paris)

1 thought on “Symfony and API Platform get “push” and real-time capabilities (Mercure protocol)”

  1. Pingback: A Week of Symfony #635 (25 February - 3 March 2019) (Symfony Blog)

Leave a Reply Cancel reply

Follow me on Twitter

My Tweets

Subscribe to this blog

Recent Posts

  • New in Caddy 2.5: Redact Sensitive Data from Your Logs
  • Building Decentralized Web Apps with Solid and PHP
  • JSON Columns and Doctrine DBAL 3 Upgrade
  • Preventing CORS Preflight Requests Using Content Negotiation
  • Symfony’s New Native Docker Support (Symfony World)

Top Posts & Pages

  • JSON Columns and Doctrine DBAL 3 Upgrade
  • Generate a Symfony password hash from the command line
  • Using the "103 Early Hints" Status Code in Go Applications
  • Symfony and API Platform get "push" and real-time capabilities (Mercure protocol)
  • API Platform 2.6: PHP 8 support, Next.js and Nuxt.js app generator, Caddy server, ActivityPub and much more!
  • Symfony's New Native Docker Support (Symfony World)
  • Preventing CORS Preflight Requests Using Content Negotiation
  • Using Next.js and Material UI Together
  • Building Decentralized Web Apps with Solid and PHP
  • Introducing the SocialShare PHP library

Persistence in PHP with the Doctrine ORM

Persistence in PHP with the Doctrine ORM

Tags

Android Apache API API Platform Buzz Caddy Docker Doctrine Go Google HTTP/2 Hydra hypermedia Hébergement Javascript JSON-LD Kubernetes La Coopérative des Tilleuls Les-Tilleuls.coop Lille Linux Mac Mercure Messagerie Instantanée MySQL Open Source PHP Punk Rock Python React REST Rock'n'Roll RSS Schema.org Security SEO SEO Symfony Symfony Live Sécurité Ubuntu Web 2.0 Wordpress XHTML XML

Archives

Categories

  • DevOps (24)
  • Mercure (3)
  • Opinions (91)
  • Programming (178)
    • Android (5)
    • Go (11)
    • JavaScript (43)
    • PHP (136)
      • API Platform (60)
      • Symfony (89)
    • Python (14)
      • Django (5)
  • Security (15)
  • SEO (24)
  • Talks (37)
  • Ubuntu (68)
  • Wordpress (6)

Blogoliste

  • API Platform
  • Les-Tilleuls.coop
  • Mercure.rocks
  • Vulcain.rocks
© 2022 Kévin Dunglas | Powered by Minimalist Blog WordPress Theme