I am trying to migrate apollo gateway to mercurius gateway.
Federated service schema is built using @apollo/federation.
Using remote rabbitmq pubsub based on graphql-subscriptions and susbcriptions-transport-ws.
Subscriptions works correctly over federated server. If subscription is used over gateway, GQL_STOP event is not forwarded to the federated server, thus federated server resolver is hanging and will handle messages until server restart.
Send mutation to resolver which will publish a message
Receive a message in subscription
Disconnect subscription and send few more mutations
If you do the same in federation service, you would see that messages are stored in the rabbitmq queue and will be consumed only after subscription is reconnected. In gateway mode, the messages goes to devnull until subscription is reconnected.
I am trying to migrate apollo gateway to mercurius gateway.
Federated service schema is built using @apollo/federation.
Using remote rabbitmq pubsub based on graphql-subscriptions and susbcriptions-transport-ws.
Subscriptions works correctly over federated server. If subscription is used over gateway, GQL_STOP event is not forwarded to the federated server, thus federated server resolver is hanging and will handle messages until server restart.
Reproduction: Source code https://github.com/valdestron/mercurius-subscriptions-test
Steps
Initialize subscription in the gateway
Send mutation to resolver which will publish a message
Receive a message in subscription
Disconnect subscription and send few more mutations
If you do the same in federation service, you would see that messages are stored in the rabbitmq queue and will be consumed only after subscription is reconnected. In gateway mode, the messages goes to devnull until subscription is reconnected.