Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

Sending and Receiving Messages

...

  • Direct - will forward messages to bound queues if the routing key matches the queue name. The routing key pattern on the binding is not required.
  • Fanout - will forward all messages to bound queues. The routing key pattern on the binding is not required.
  • Topic - used for pub/sub - will forward to queues where the message's routing key matches the routing key pattern on the binding between the Queue and the Topic Exchange.
  • HeaderA headers exchange routes messages based on arguments containing headers and optional values. Headers exchanges are very similar to topic exchanges, but route messages based on header values instead of routing keys. Header Exchange can route based on customer Message Headers as well as the following RabbitMQ message properties
    • content_type
    • content_encoding
    • priority
    • correlation_id
    • reply_to
    • expiration
    • message_id
    • timestamp
    • type
    • user_id
    • app_id
    • cluster_id

Exchanges can be bound to Queues or other Exchanges.
Exchanges and Queues are linked via Bindings - sometimes the Binding uses a Routing Key Pattern. The Message's Routing Key can be a single word. More generally, it can be several words delimited by dots. The Routing Key pattern supports * for any 1 word and also # for any number of words.

...

Rabbit Payloads are an array of bytes. So even for String based messaging - without a converter, you have to convert a String to/from bytes.
It was straightforward to send messages to Queues using org.springframework.amqp.rabbit.core.RabbitTemplate
It was straightforward to recv messages from Queues using the annotation : org.springframework.amqp.rabbit.annotation.RabbitListener

...