[Part 3] Executing batch jobs in a multi-container environment using NodeJS and express
August 4, 2021
Mohammed Ali Chherawalla
Software Engineer
Contents
This is the last tutorial in a 3-Part series. If you haven't completed the first 2 tutorials I would recommend going through them first here & here.
Add support for subscriptions
We will use RedisPubSub from graphql-redis-subscriptions to publish to subscription topics. We will publish a message when the user invokes the scheduleJob mutation. A new CRON will be registered that will execute every minute. This is done so that "an automated" message is published to the notifications topic every minute.
Very soon you'll see another message come up in the subscriptions tab because of the EVERY_MINUTE CRON
Commit your code using the following git commands
git add .
git commit -m 'Add support for graphql redis subcriptions!'
Liked what you read? There's more where that came from! Satisfy your craving for all things digital product strategy on LeadReads. Round out your perspective with exclusive stories straight from C-suite thought leaders.
If this series piqued your interest please stay tuned for the next tutorial in which we will write a CD pipeline to deploy this application using ECS.
I hope you enjoyed reading this series on how to create container-aware CRONS, scheduled jobs, and GraphQL Subscriptions. If you have any questions or comments, please join the forum discussion on Twitter.
Every full moon we will visit your inbox.
Thank you! Your submission has been received!
Oops! Something went wrong while submitting the form.
2024
By using this website, you agree to the storing of cookies on your device to enhance site navigation, analyze site usage, and assist in our marketing efforts. View our privacy policy for more information