https://grokonez.com/spring-framework/spring-amqp/springboot-rabbitmq-headers-exchange
SpringBoot RabbitMq Headers Exchange
In the past post, we had introduced about RabbitMQ Topic Exchange. Today, JavaSampleApproach will show you how to work with SpringBoot RabbitMQ Headers Exchange.
Related posts:
x-match
has 2 values {all
, any
} where all
is the default value of a headers binding.
- x-match
= all means that all the values must match.
- x-match
= any means just one matching header value is sufficient.
Scenarios with above design:
layer=system
, level=error
}, the message will be delivered to 2 queues {Q1, Q2}.layer=application
, level=error
}, the message will be delivered to one queue Q2.layer=system
, level=info
}, the message will be discarded.Step to do:
– Create SpringBoot projects
– Implement RabbitMq producer
– Implement RabbitMq consumer
– Run and check results
spring-boot-starter-amqp
:
https://grokonez.com/spring-framework/spring-amqp/springboot-rabbitmq-headers-exchange
SpringBoot RabbitMq Headers Exchange
#springboot #rabbitmq #header-exchange