go - Redis Pub/Sub Ack/Nack -


is there concept of acknowledgements in redis pub/sub?

for example, when using rabbitmq, can have 2 workers running on separate machines , when publish message queue, 1 of workers ack/nack , process message.

however have discovered redis pub/sub, both workers process message.

consider simple example, have go routine running on 2 different machines/clients:

go func() {     {         switch n := pubsubclient.receive().(type) {         case redis.message:             process(n.data)         case redis.subscription:             if n.count == 0 {                 return             }         case error:             log.print(n)         }     } }() 

when publish message:

conn.do("publish", "tasks", "task a") 

both go routines receive , run process function.

is there way of achieving similar behaviour rabbitmq? e.g. first worker ack message 1 receive , process it.

redis pubsub more broadcast mechanism.

if want queues, can use blpop along rpush same interraction. keep in mind, rabbitmq sorts of other stuff not there in redis. if looking simple job scheduling / request handling style, work fine.


Comments

Popular posts from this blog

dns - How To Use Custom Nameserver On Free Cloudflare? -

python - Pygame screen.blit not working -

c# - Web API response xml language -