ActiveMQ Queue and Topic, activemqqueue
ActiveMQ supports two modes: Queue mode and Topic mode.
1. Queue mode (P2P mode)
The producer sends a message, and the consumer introduces the message.
The queue adopts the FIFO policy.
When a Queue has multiple consumers, the consumers Queue in sequence. The first consumer receives a message from the Queue and then returns to the end of the Queue to requeue. For example, if a producer sends a message numbered 1-5, assume that the Queue has two consumers named c1 and c2 respectively, and c1 is placed before and c2 respectively, according to the above rules, c1 receives messages 1, 3, 5, and c2 receives messages 2, 4.
2. Topic mode (broadcast mode)
The producer sends messages and the consumer introduces the messages.
When a Topic has multiple consumers, all consumers will receive each message sent by the consumer.