Messaging middleware RabbitMQ and search server Solr

Quartz has four core interfaces Job, JobDetail, Trigger and Scheduler [15]. The operating principle of Quartz is shown in the figure. Scheduler is the headquarters of the entire task scheduling, which has registered a lot of JobDetail and

Trigger. Trigger mainly has two interfaces: expression trigger and simple trigger. The function of expression trigger is more powerful, and it is widely used in development to set how often to schedule a task. When the Scheduler container starts, JobDetail and Trigger will be registered on the Scheduler container. After registration, JobDetail and Trigger will form a pair of assembled jobs. There is a thread pool in the Scheduler. According to the rules configured in the Trigger, a thread is opened for each job to execute in parallel.
Insert picture description here

Figure Quartz operating principle diagram

Messaging middleware RabbitMQ and search server Solr

RabbitMQ is an open source messaging framework, which is widely used by large Internet companies such as NetEase and iQiyi. RabbitMQ mainly contains the
roles of Producer (message producer), Exchange (switch), Queue (message queue), and Consumer (message consumer). The operating principle is shown in the figure.

Figure RabbitMQ operating principle diagram

Insert picture description here

Both Client A and Client B are message producers. The messages they produce are not directly delivered to the message queue, but first go through the exchange (Exchange). In RabbitMQ, a very important concept is the binding
(Binding). The switch and the queue are bound according to certain rules, and then the switch knows which queue or queues to deliver the message to. Finally, the consumer subscribes to the messages in the queue and consumes according to the first-in first-out rule. Compared with other message middlewares such as Kafka, RabbitMQ has obvious advantages in terms of ease of use and stability. It can easily delete or add cluster nodes when expanding the cluster. RabbitMQ also has a powerful visual web management interface, which is very friendly to developers.
Solr is a full-text search server developed by Apache. It is optimized on the basis of Lucene and encapsulates the entire index operation function. Compared with the previous search framework, Solr provides a richer query language, and has greatly optimized search performance and indexing [21]. Solr can not only intelligently decompose search keywords submitted by users, but also filter out tone pauses such as "also" and "的".
In addition, Solr also provides users with a visual operation interface. Developers can conveniently check the configuration and operation of Solr through the visual interface. The Solr index is implemented by adding the described Field and its content into an XML document, and then submitting the document to the Solr server using the POST method. The Solr server then updates the index based on the content in the submitted XML document. At this time, the search index has been established and can be searched through the Solr server. Finally, search keywords are formed as needed, and the caller sends a GET request to the Solr server. The Solr server returns the search results in XML or JSON format. The caller obtains the returned XML or JSON data and parses it.

Guess you like

Origin blog.csdn.net/qq_42918433/article/details/113921755