What is more efficient: add fields to the message or create a custom header? RabbitMQ

StackOverflow https://stackoverflow.com/questions/17623431

  •  03-06-2022
  •  | 
  •  

Domanda

I need to append a meta data to each message when publishing to the queue. The question is which method is more efficient?

  1. Add custom fields to every message body
  2. Add custom headers to every message

Just in case:

  • Publisher is on AWS m1.small
  • Messages rate is less than 500 msgs/s
  • Rabbit library: pika (python)
È stato utile?

Soluzione

Efficiency in terms of speed, there is probably no answer to your question, since there are efficient parsing methods available to extract the meta data from your messages after they leave RabbitMQ.

But in case of using the meta data to filter your messages, it would be more efficient to do that in RabbitMQ, since you can do that filtering inside of RabbitMQ by using header exchange.

Autorizzato sotto: CC-BY-SA insieme a attribuzione
Non affiliato a StackOverflow
scroll top