the project contains 2 parts(part 2 is recommend),they are:
- Official rabbitMQ implements(reference the documents of the rabbitMQ)
- api
- dispatcher
- client
- producer
- consumer
- The SpringAMQP implements
- SpringAMQP:spring_amqp_client
- SpringAMQP:spring_amqp_producer
API module: provides interface for producers to add messages.
The message dispatcher, peripheral system register here(the address and topic info),when there are some messages that matches the topic,It will dispatch the messages to the peripheral system.
The client implementation,it contains 2 parts:
- register to disptacher
- interface to receive messages.
The message producer(Business related),in this demo,we will read records form db that are not processed, and then put it into MQ.
The message consumer(Business ralated),in this demo,we will receive messages from the MQ,and then print the messages.
the amqp consumer demo.
- consumers binding queues to the exchange by different routingKeys.
- producers push messages to the exchange,the exchange dispatch messages to queues by the routingKeys.
- consumers receive messages from the queues that they bound(if there were multi consumers bound one queue,they will receive messages evenly).
amqp messages producer,the producer push the messages to the exact exchange,and attach the routingKey,the exchange will dispatch the messages to all the Queues which match the routingKey.
The official documents:http://www.rabbitmq.com/download.html
visit:http://localhost:15672
account/password:guest/guest
The official documents:http://www.rabbitmq.com/getstarted.html