-
-
Notifications
You must be signed in to change notification settings - Fork 315
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
Using NATS as backend for Mercure API/Protocol? #847
Comments
This is planned in the on-premise (nonfree) version! I'll let you know as soon as this feature is available. |
as far as i understand, mercure uses boltdb as events store |
@g41797 it already has a pluggable transport support, and many transports supporting clustering as available in the paid version: https://mercure.rocks/docs/hub/cluster |
Any guidance you could provide on how to at least start implementing something like this (a particular file and class to look at?) would be much appreciated! Though I completely understand if you prefer to keep that close to the chest for your paid on prem versions |
i have no clue regarding clustering, but i can try to develop support for nats js and memphis |
I think I'm starting to understand now. Each "backend" - bolt, local, redis, Kafka, postgres - is implemented via a Transport The bolt and local ones are included in this repo, and the cluster ones are provided when you pay for the on prem version. So, a NATS Transport would need to be made, using the Transport.go file as a starting point (and the bolt and local ones as reference). I figure it would involve importing the nats.go client in the Transport to create a connection and relay the pubsub requests. I'll poke around to see what I can figure out. I've always wanted to learn Go, so this is a good opportunity to get started. I expect that Copilot Chat will be helpful here if I add the repos to a workspace and open the transport files. |
My application architecture revolves around NATS and I would like to add an SSE + Ajax mechanism to communicate with browsers. I also intend to switch my php webserver from Litespeed to Frankenphp.
Given that NATS already has considerable pubsub capabilities and that Mercure is already integrated with Frankenphp, I'm wondering if I could use Mercure's api/protocol to communicate with the browser but use NATS as the pubsub backend.
Does this seem like it would be possible? If so, could you point me towards the parts of Mercure's code that I would need to modify? I'm happy to contribute this back to the project if I get it working. I understand, however, if it isn't something that you're interested in.
Thanks!
The text was updated successfully, but these errors were encountered: