Sending and Receiving Messages
...
- Direct - will forward messages to bound queues if the message routing key matches the routing key in the binding.
- Default - The Default Exchange is a special Direct Exchange which doesn't have any explicit bindings. The message is sent to the Queue whose name matches the routing key. The Default Exchange has an empty name. The Default Exchange cannot be deleted.
- Fanout - will forward all messages to bound queues. The routing key pattern on the binding is not required.
- Topic - used for publish/subscribe - will forward to downstream queues/exchanges where the message's routing key matches the routing key pattern on the binding between the Topic Exchange and the bound, downstream Queues/Exchanges.
- Header - A 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. Headers Exchange can match on any or all of a list of header/value pairs. In addition to custom headers, Header Exchanges can route based the following RabbitMQ message properties too.
- content_type
- content_encoding
- priority
- correlation_id
- reply_to
- expiration
- message_id
- timestamp
- type
- user_id
- app_id
- cluster_id
...
Rabbit Payloads are an array of bytes. Without a converter, you have to convert messages to/from bytes. Spring's RabbitTemplate performs the conversion for String payloads.
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
...
At some point, we may be able to create a Spring/Rabbit support library. - Done in https://github.com/Health-Education-England/TIS-rabbit-mongo-spring-boot-starter
DeadLetterQueues / TTL / Durability - Done a demo with DLQ and TTL - needs documenting.
...