Joke Collection Website - Public benefit messages - What is ActiveMQ and what is it used for?
What is ActiveMQ and what is it used for?
1. The ActiviMq message queue solves the problem of service decoupling and alleviates the situation where the server cannot handle the large concurrency of the service. (kafka, rabbitMQ, activiMQ)
Other functions: asynchronous processing, message communication, traffic peak reduction, application decoupling
Application scenarios:
1. User When registering, the key point is to save user information in the database. Sending text messages for verification or sending emails increases the complexity of the business. At this time, using MQ, sending text messages and sending emails to notify MQ will be completed by another service platform.
2. Search platform and caching platform
Query data, establish cache and index, do not query from the database, query from the cache or index library, when the database is added, modified or deleted When a message is sent to MQ, the cache platform or index platform obtains the message from MQ and updates the cache or index.
ActiveMQ uses the standard producer (completes the production of messages and sends messages) and consumers (obtains messages and completes its own business logic) model
There are two data structures
Topic (publish and subscribe) One producer corresponds to multiple consumers. Messages are not persisted by default and persistence needs to be configured manually. If server A hangs up and another message is produced, it will be used by server B. Even if it is restarted, server A will no longer get the message
Product system, inventory system, generate product details page system, now you want to add a product information, the information must be known to the inventory system and the product information details page system.
Queue (point-to-point), one producer corresponds to one consumer, default message persistence
StringMessage
mapMessage
byteMessage
objectMessage
To complete message persistence in topic mode, it is necessary to ensure that each consumer has a unique clientID (this article is from Beida Jade Bird)
- Previous article:Happy birthday to primary school students
- Next article:Payment standard of Wuxi residents' medical insurance
- Related articles
- Sometimes mobile phones can't receive text messages.
- How to cancel the credit card of Guangfa Bank?
- What if the ringtone of vivo y22 SMS doesn't ring? But I checked the settings. The SMS ringtone is on. And there is no vibration adjustment. Why?
- There are two mobile phone numbers. Can you transfer incoming calls and text messages from 1 number to 1 mobile phone?
- How to inquire whether Beijing minibus won the lottery?
- How to resume deleting SMS on iphone5s?
- What should I do if the mobile phone registered by Huawei Cloud Service is cancelled?
- What are the names and singers of all the songs in the Korean drama Love Rain?
- Some people call me a liar. What if she delivers it by express and I don't pay?
- How can I check the access time of my mobile phone number?