Use Case 1

A Producer produces two types of messages: public and private.

A Public message consists of information that every consumer should be able to consume by binding their queues to the relevant exchange and routing key.

A Private message is one that is targeted for a specific Consumer or group of consumers and not for everyone.

Apart from this, a Consumer of a private Message can also consume public messages, but the reverse is not true.

Since RabbitMQ does not support authorization based on Routing Keys, only on VHosts, exchanges, and queues, how can we best handle such a scenario?

The preceding situation can be handled using Message Encryption:

  1. A Producer creates a private message for intended recipients.
  2. The message is encrypted using public-key encryption to prevent eavesdropping.
  3. The message is published to the Topic Exchange with a routing key that identifies the message as being private.
  4. The Consumers who have the key to decrypt the message declare the queue binding on the exchange.
  5. The RabbitMQ broker looks at the message-Routing key and puts it in an appropriate queue.
  6. If the consumer who is not intended for the private message gets the message, they would not be able to do anything with it as they do not have the key to decrypt the message.

All these steps will happen over and above the message Signature and verification process.

..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset
3.128.186.177