#Ballerinax/Redis to implement the pub/sub mechanism
1 messages · Page 1 of 1 (latest)
Looping in @grizzled surge @balmy flame
In the current ballerina redis connector, support for the pub-sub feature is not available.
If you need a pubsub implementation, try this:
https://central.ballerina.io/xlibb/pubsub
This is a nice article published about the subject:
https://medium.com/ballerina-techblog/an-introduction-to-pub-sub-in-ballerina-e259b38307fb
Do note that the article uses nuvindu/pubsub, but now the package is published as xlibb/pubsub.
what is the broker behind it ?
This does not use any broker, just a plain publisher, subscriber package. You can integrate this to any implementation.
@celest nacelle in pub sub, there are 3 main actors, the broker, subscriber and the publisher. As per the above link , all the actors seems to reside in same runtime instance. Can we deploy these actors separately? If so, what is the address of the broker? I am trying to understand the practical use of this package.
@noble dock We use pubsub to publish/subscribe to a particular topic. In this implementation, a pipe (xlibb/pipe) instance is used as a broker, basically, an in-memory message queue. This can be used to publish/subscribe asynchronously inside the same application. Seems like your requirement is different here. In your case, the Ballerina Kafka library maybe a solution? But then again, you have to have a Kafka broker up and running.
There are no message brokers implemented in Ballerina currently.
@celest nacelle UGH that's the wrong answer. Using an in-memory "broker" is not useful for many scenarios.
Ballerina has connectors to Kafka, RabbitMQ, Azure Service bus, any JMS broker and various others. There's also a websub hub (written in Ballerina itself and backed by Kafka) that you can use if you want to do webhook based pub/sub.
@bleak thicket if the Redis connector needs to add more stuff that can be done too (I'm not familiar with Redis pub/sub).