Dynamic Node ActiveMQ Notes Chapter 1 JMS Overview

Chapter 1 JMS Overview

1-1 Overview of Java Message Service JMS

Information communication between two systems or between distributed systems is a common scenario in our development. For example, system A wants to send information to system B. How should we deal with this problem? In 1999, the original SUN company took the lead in proposing a message-oriented middleware service - JMS specification (standard); (httpClient, hessian, dubbo, webservice, jms five kinds) JMS is Java Message Service (abbreviation of
Java Message Service) ), is one of the standards/specifications of Java EE. This specification (standard) points out: The sending of messages should be asynchronous and non-blocking; that is to say, the sender of the message returns directly after sending the message, and does not need to wait for the receiver to receive the message before returning. The sender And the receiver can be said to be independent of each other. Therefore, this specification (standard) can reduce or eliminate system bottlenecks, realize decoupling between systems, and improve the overall scalability and flexibility of the system.
JMS is a set of standard APIs defined in Java EE. It is not a message service system itself. It is an abstraction of message delivery service, that is to say, it defines the interface of message delivery without specific implementation.
Java EE has been renamed Jakarta EE (Jakarta)

1-2 JMS specification development history

The JMS specification has undergone years of development, and has been upgraded several times with Java EE, from version 1.0 to the latest 2.1, they are:

  • Java EE 8 – > Java Message Service API 2.1
  • Java EE 7 – > Java Message Service API 2.0
  • Java EE 6 – > Java Message Service API 1.1
  • Java EE 5 – > Java Message Service API 1.1
  • J2EE1.4 – > Java Message Service API 1.1

1-3 ActiveMQ overview

We know that JMS is just a set of specifications and interfaces for message services, and there is no specific implementation, and ActiveMQ is the specific implementation of JMS specifications;

  • ActiveMQ is a project under Apache, developed in Java language;
  • ActiveMQ is a very popular open source message server that implements the JMS specification;

1-4 Relationship between ActiveMQ and JMS

We know that JMS only defines a set of specifications and standards related to message transmission, and does not really implement it. That is to say, JMS only defines a set of interfaces; just like JDBC abstracts relational database access, JPA abstracts objects and relational databases The same as the mapping, the specific implementation of JMS is provided by different message middleware vendors. For example, Apache ActiveMQ is the specific implementation of the JMS specification. Apache ActiveMQ is a message service system, but JMS is not.

1-5 ActiveMQ environment construction

ActiveMQ needs Java support to run. First, you need to configure Java environment variables;
1. Download
2. Unzip: tar -zxvf apache-activemq-5.15.2-bin.tar.gz -C /usr/local/
where -C /usr/ local/ Specify where to decompress the file. After decompression, the installation is complete and you can use it without other operations.
3. Switch to cd/usr/local/apache-activemq-5.15.2 in the decompressed activemq bin directory Start
4. Switch to the bin directory, start: ./activemq start
5. Switch to the bin directory, close: ./activemq stop
The problem that cannot be closed

  1. Delete all files and directories under the data directory
  2. Delete the tmp directory under the activeMQ main directory

There are two port numbers after startup, one is web console: 8161, the other is message service broker connection port: 61616
web management console admin URL address: http://localhost:8161 default login account admin password admin, note: Linux Before fire protection, the message service broker URL address should be closed: tcp://localhost:61616

1-6 Environment Construction under Windows

Download the compressed package of activeMQ windows version and decompress the downloaded compressed package. After decompression, you can directly use the bin in the decompressed directory. Enter cmd in the address bar and confirm. In the dos window, enter: activemq start to start, and close: activemq
stop

Guess you like

Origin blog.csdn.net/f5465245/article/details/130721466