golang RabbitMQ exchange direct, amqp

Viewed 61

I'm using RabbitMQ using go language.

And I'm going to make real-time comments and like notifications using RabbitMQ.

When user B comments on user A's post, want to notify user A's screen in real time, "Comments have been created."

Sender

  1. err = channel.ExchangeDeclare("realtime", "direct", true, false, false, false, nil)
  2. err = channel.Publish("realtime", "like-key", false, false, message)

Consumer

  1. q, err := channel.QueueDeclare("realtime", true, false, false, false, nil)
  2. err = channel.QueueBind(queueName, "zxcv", "realtime", false, nil)

Even though I set the route-key as a part of the bind strangely, I still receive a message from the queue. Can you tell me why?

0 Answers
Related