Hi,

I am trying to set up a First In, First Out (FIFO) queue using DigitalOcean’s Managed Redis hosting instead of AWS SQS. Now that I’ve set up and successfully connected to my Redis cluster, I am wondering:

1) How can I push new JSON objects to a FIFO queue in my cluster using REST HTTP requests?
2) How can I read from my FIFO queue using REST HTTP requests?

Any recommendations or pointers to other reference material would be appreciated!

These answers are provided by our Community. If you find them useful, show some love by clicking the heart. If you run into issues leave a comment, or add your own answer to help others.

×
2 answers

Redis is a caching database with key-value pairs. It is not a queueing storage, so it would not guarantee the FIFO sequence.

What I can recommend to you is to check the pub-sub model of Redis and publish the messages as soon as they arrive at a processing unit. You can learn more about this at Redis documentation.

So, to answer your question:

How can I push new JSON objects to a FIFO queue in my cluster using REST HTTP requests?

You will “publish” the messages on a topic. You can create a single topic to publish all the objects to or create a partition in the topics. But this will not be REST API, rather it will use Redis protocol. Please see the link I provided above.

How can I read from my FIFO queue using REST HTTP requests?

You will “subscribe” to the topic and listen for any messages on that topic thread. As soon as the message arrives, you will be able to process it.

Here is a sample application that I developed using .NET to send and receive messages (like a chat application) using Redis; please read here

Following up with the solution we ended up choosing:

We deployed a managed RabbitMQ instance on DigitalOcean, courtesy of https://www.cloudamqp.com/. RabbitMQ lets us set up various queues and then send and receive messages over HTTP: https://www.cloudamqp.com/docs/http.html

Because we can transmit messages to RabbitMQ using HTTP, we’re able to easily make use of web-based automation tools.

Submit an Answer