preface
Active is an open source, message-oriented (MOM) middleware that implements the JMS1.1 specification to provide efficient, scalable, stable, and secure enterprise-level messaging for applications. Ac-tivemq uses a license provided by Apache, and its implementation code can be modified by anyone.
ActiveMQ is designed to provide standard, message-oriented middleware for application integration messaging across multiple languages and systems. ActiveMQ implements the JMS standard and provides many additional features. This article will introduce the use of ActiveMQ API in detail.
Public account: “Asanha’s IT Hut”
1. JMS concept?
“What is JMS?”
-
JMS———JAVA Message Service
-
The JAVA messaging service, which is an interface provided by Sun, is just a specification that, like JDBC, requires the implementation product of the current specification.
“What can JMS do?”
-
The ability to publish information to a destination
-
This message can be consumed from the destination
2. Two communication models
“The communication concept of queues:”
-
Feature: When we have multiple consumers in the same queue, the sum of the data of multiple consumers is the total data in the original queue
-
The maximum application scenario of the queue communication model is peak elimination of traffic and high concurrency processing
“Communication models for topics:”
-
Features: When there are multiple consumers in our queue, the data consumed by these consumers is the same
-
The application scenario of the topic consumer communication model is asynchronous communication between services under microservices
3. MQ implementation products
“Realizing the product:”
-
ActiveMQ
-
RabbitMQ
-
RockerMQ
-
Kafka (originally designed for distributed logging, Kafka was later used for message queues due to the strict ordering of logs)
4. Common nouns in JMS
Common nouns:
-
ActiveMQConnectionFactory: this is to create the connection factories
-
ConnectionFactory: The factory of the connection
-
Connection: A Connection between JAVA and MQ
-
-Blair: It’s your Destination.
-
They are all producers.
-
Consumer
-
Session: Session (each operation to MQ is called a Session)
-
The Queue, Queue
-
Topic: the Topic
What is a message queue
“Message queues are simply places where temporary data is stored:”
-
Producer ———–> on storage media
-
Consumer ———–> on storage media
“Message queues are similar to Courier companies:”
-
You can give it to the express company
-
The target can also pick up items from the Courier service
6. What is ActiveMQ
“Meaning:”
- ActiveMQ is a JMS implementation product, which can implement all functions under JMS
7. What can ActiveMQ do
“Main function:”
-
Flow peak elimination processing
-
Asynchronous communication of modules under microservice
-
Handle orders placed with high concurrency
-
Handle high concurrency on third party platforms
-
Assist message tables can achieve the ultimate consistency of distributed transactions
8. Installation of ActiveMQ
“ActiveMQ Installation and configuration:”
9. Use of ActiveMQ API
“API Use for AcatveMQ:”
- Queue usage (producer)
- Queue usage (consumer)
- Producer of the topic model
- Consumers of thematic models
This is the end of the introduction of ActiveMQ. There will be more articles about ActiveMQ series in the future. Thank you for your support!
“Like” to prove you still love me