0

I have a scenario like I would be storing details on the redis-database and this would publish messages to external API's.

Question:

  1. Is that feasible to publish message from Redis to outside world? - All pub/sub I have seen are within redis-cli.

enter image description here

1 Answers1

0

Yes -- you can pub/sub to clients, but those still have to be Redis clients that also know about pub/sub. Per your account handle, you probably need to look for a simple-but-sufficient Java library.

I wrote about a simple application I create for my own use: a listener process fetches market data (for less than a handful of contracts) and publishes them to Redis from where clients (in a different process and/or on a different machine) can subscribe. Works great. I do this in R because I had already written a (C++ based) client for R (around hiredis) to which we then added pub/sub.

The blog post is here, and I also wrote about Redis for market monitoring in this short arXiv paper -- and there is a corresponding short arXiv paper introducing Redis.

Dirk Eddelbuettel
  • 360,940
  • 56
  • 644
  • 725
  • Thanks for the reply Dirk.. I had the same understanding like the consumer has to be a code (written in nodejs, java, etc..) listening to the redis pub/sub. Whereas my search was something like can this be a external push to outside world.. I guess there are no way to push messages outside redis unless we subscribe to it. – Java Techie Aug 03 '22 at 00:28
  • Redis notifies. That is exactly what happens. It is actually quite thrilling to work with this because Redis is a neutral middle man. You can debug by sending messages with any compliant API and receive with another. But one needs to _publish_ so that Redis can notify all _subscribers_. – Dirk Eddelbuettel Aug 03 '22 at 00:44