Installation and introduction of ActiveMQ

message middleware

Let's briefly introduce the message middleware, just have a basic understanding of it, the message middleware (MOM: Message Orient middleware).

Message middleware has many uses and advantages: 
1. Transfer data from one application to another, or from one software module to another; 
2. Responsible for establishing network communication channels for reliable data send. 
3. Ensure that the data is not retransmitted or lost 
4. Can realize cross-platform operation, and can provide data transmission services for software integration technicians on different operating systems

SQM

First of all, I will briefly introduce MQ. The English name of MQ is MessageQueue. The Chinese name is also the message queue that everyone uses. Why do you use it? To put it bluntly, it is a container for receiving and forwarding messages, which can be used for message push.

Let's enter our topic today and introduce ActiveMQ to you:

ActiveMQ

Brief overview of ActiveMQ

Apache ActiveMQ ™ is the most popular and powerful open source messaging and Integration Patterns server.
Apache ActiveMQ is fast, supports many Cross Language Clients and Protocols, comes with easy to use Enterprise Integration Patterns and many advanced features while fully supporting JMS 1.1 and J2EE 1.4. 
  • 1
  • 2
  • 3

ActiveMQ is produced by Apache, one of the most popular and powerful open source message bus. ActiveMQ is a JMS Provider implementation that fully supports JMS1.1 and J2EE 1.4 specifications. It is very fast, supports clients and protocols in multiple languages, and can be easily embedded into enterprise application environments with many advanced features.

Let's download a version and play with it.

Download ActiveMQ

Official website: http://activemq.apache.org/ 
Now the latest version of ActiveMQ is 5.11.1, the download is very simple, so no more screenshots.

Running ActiveMQ service

  1. Download and unzip 
    After everyone is good now, unzip apache-activemq-5.11.1-bin.zip, we can see its overall directory structure: 
    write picture description here 
    From its directory, it is still very simple: 
    • bin stores script files
    • conf stores the basic configuration files
    • data stores log files
    • docs store the documentation
    • examples store simple examples
    • lib stores the jar package required by activemq
    • The directory used by webapps to store projects
  2. When we start ActiveMQ 
    , we know the basic directory of activemq. Let's run the activemq service. Double-click the activemq.bat script file in the bin directory or run the activemq.bat under your own computer version, and you can see the effect of the following figure. 
    write picture description here

From the above figure, we can see the storage address of activemq and the address to be accessed by the browser. 
3. Test

The default TCP connection port used by ActiveMQ is 61616. By viewing the information on this port, you can test whether ActiveMQ has successfully started netstat -an|find “61616”

C:\Documents and Settings\Administrator>netstat -an|find "61616" 
TCP     0.0.0.0:61616     0.0.0.0:0       LISTENING
  • 1
  • 2
  • 3

4. 
When ActiveMQ is started by default, the built-in jetty server is started, providing an admin application for monitoring ActiveMQ. 
admin: http://127.0.0.1:8161/admin/

Username and password are both admin

write picture description here
5. At this point, the server is started

To stop the server, just press Ctrl+Shift+C and then type y.

Let's briefly talk about ActiveMQ features, there are many online, just to ensure the integrity of the blog post.

ActiveMQ feature list

  1. Write clients in multiple languages ​​and protocols. Languages: Java, C, C++, C#, Ruby, Perl, Python, PHP. Application Protocol: OpenWire, Stomp REST, WS Notification, XMPP, AMQP
  2. Full support for JMS1.1 and J2EE 1.4 specifications (persistence, XA messages, transactions)
  3. For the support of Spring, ActiveMQ can be easily embedded into the system using Spring, and also supports the features of Spring 2.0
  4. Passed the test of common J2EE servers (such as Geronimo, JBoss 4, GlassFish, WebLogic), and through the configuration of JCA 1.5 resource adaptors, ActiveMQ can be automatically deployed to any compatible J2EE 1.4 commercial server.
  5. Supports multiple transport protocols: in-VM, TCP, SSL, NIO, UDP, JGroups, JXTA
  6. Supports high-speed message persistence via JDBC and journal
  7. High-performance clustering, client-server, peer-to-peer, guaranteed by design
  8. Ajax support
  9. Support integration with Axis
  10. It is easy to call the embedded JMS provider for testing

When to use ActiveMQ?

  1. Integration between multiple projects 
    (1) Cross-platform 
    (2) Multilingual 
    (3) Multi-project
  2. Reduce the coupling degree of modules between systems, decoupling 
    (1) Software scalability
  3. System front and rear isolation 
    (1) Front and rear isolation, shielding high security area

In fact, there are many applications of ActiveMQ, you can check it online, no more examples.

Guess you like

Origin http://43.154.161.224:23101/article/api/json?id=325931934&siteId=291194637