Figure A
ACTIVEMQ now more and more complex, like a martial arts master, will be more and more of the routines, want to see his way, a bit not easy. But if you can put his "vein" may be seen clearly. Activemq as software also has its "pulse", which is what we often call the domain model.
Domain models, especially medium-sized software systems like ACTIVEMQ, have evolved over and over again in the process of deepening understanding of the problem domain. We analyze ACTIVEMQ's domain model this time, also in this attitude, this article is 1.0 version, as we continue to understand, the domain model analysis will continue to deepen.
Before I make a formal analysis, I would like to state that the relationship between the classes that appear in the diagram, we want to achieve a "spirit of the Spirit", and we have just chosen the most important part of the domain class.
The role of each domain class in the model is introduced first, and then the relationship between them is described.
Broker: A holistic representation of ACTIVEMQ
Regionbroker: Responsible for distributing broker operations to the appropriate message area
Region: ACTIVEMQ There are currently four main message areas: Queue domain (queueregion), subject domain (topicregion), temporary queue domain (tempqueueregion), temporary subject domain ( Temptopicregion)
transportconnection: Represents a communication connection
Destination: The destination of the message, mainly includes two kinds of queue, two kinds of topic
Subscription: Consumers of messages, subscribers
messagestore: Message persistence storage, like the more complex kaha storage mechanism is placed in this
pendingmessagecursor: Message distribution pointers waiting to be sent to consumers
ConnectionContext: The connection context required to maintain the sending request
Let's take a description of the relationship of these domain classes:
1, a regionbroker has 4 kinds of message domain objects.
2. Regionbroker has all destination objects (destination).
3, each message domain (region) also has their corresponding 0 or N destination objects (destination).
4, at the same time each region also has their corresponding 0 or n message consumers, subscribers (subscription).
5. Each destination has a corresponding persistent storage (Messagestore), and a message distribution pointer (pendingmessagecursor) waiting to be sent.
6. Message consumers and destinations can have 0 or n each other.
7, each consumer has a corresponding Connectioncontext,connectioncontext includes a Transportconnection object, through the transportconnection to the real message to consumers.
8. Transportconnection can also be used as a communication connection to listen for information sent by the message producer, so each transportconnection will point to the broker object.
The above relationship description is static, not easy to understand, like human tendons, so below we through the message in the ACTIVEMQ flow process, to get through the activemq "seven tendons eight veins."
Figure II
The process of consuming producers sending messages and consumer messages to the ACTIVEMQ process as shown above, the path to messaging passes through the core domain model, with the following steps:
Step 1: The producer sends a message to ACTIVEMQ by sending the transportconnection to ACTIVEMQ for it to establish a good.
Step 2:transportconnection object to find Regionbroker.
Step 3:regionbroker Find the corresponding message area (region) based on the type of message.
Step 4: The region finds the corresponding message destination within itself.
Step 5, 6: The destination first persists as needed and uses the message pointer object to be sent.
Step 7: When there is the right message for consumers and subscribers to come, the destination will find these consumers.
Step 8, 9: Through the consumer corresponding to the transportconnection, the message from the ACTIVEMQ, sent to the corresponding consumer process.