Skip to main content

Fundamentals

Push Type Message Queue

  • optimized for latency
    • messages are pushed out as soon as they arrive
  • client (consumer) is lightweight
  • load balancing amount competing consumers
  • flow control
    • hard to configure the push speed when not knowing the current work load of consumers (some consumers might be busy with something, sneding too much messages to it may cause it to degrade in performance)
  • broker logic is more complex: where to send messages, how fast to send them, etc
  • RabbitMQ, ActiveMQ

Pull Type Message Queue

  • optimized for throughput: takes as many as necessary and waiting for consumers to digest
  • better suited for message replay
    • say if something goes wrong, and the consumer finds out 24 hours later, it can call the broker to replay all the messages in the last 24 hours
    • consumer controls the logic
  • polling in a tight loop
    • needs to constantly calling the broker to check for new messages, resulting in unnecesary resource waste
  • client logic is more complex
  • Kafka, SQS